Compiling a dealii project without cmake

32 views
Skip to first unread message

Lucas Myers

unread,
Jun 17, 2021, 12:36:10 PM6/17/21
to deal.II User Group
Hi Everyone,

This is sort of a silly question, but how feasible is it to compile and link a dealii project without cmake? I'm pretty new to using C++ so I'm trying to get a handle on the most basic way to do things.

I wrote a little file `dealii_function_test.cpp` to test out the Function, Point, Vector, and Full_Matrix classes, as well as a simple accompanying Makefile. The former just creates objects of those types and then prints the contents. The latter searches through `src` and `include` directories in my own project directory. I can post the text to these files if it would be helpful.

When I try to compile I get a lot of "undefined reference to" errors pointing towards dealii functions. I can post a file with the error output if that would be helpful. Do I just need to include a reference to the relevant dealii object files? And if so, what do those look like/where might they be? In my `/usr/local/lib` directory I have some dealii libraries (named some combination of libdeal_II, so, g, and 9.2.0). Do I need to explicitly reference those? And if so, why does make not know to look there?

For reference I'm running WSL2 on Windows 10 with a Debian distro.

Thanks so much,
Lucas

Wolfgang Bangerth

unread,
Jun 17, 2021, 6:34:57 PM6/17/21
to dea...@googlegroups.com

Lucas,
For any non-trivial project, trying to set things up "by hand" is going to
result in disappointment and frustration. You will have to know not only where
header files are located, but also the name and location of the deal.II
library you want to link with, the flags used to drive the compiler, possibly
preprocessor #defines, and what other libraries deal.II depends on. All of
this is information that cmake exports and that your project would
automatically import if you used cmake.

This is wheel already invented. Don't waste your time trying to re-invent it :-)

Cheers
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages