Compile deal.II test Source file

42 views
Skip to first unread message

Junxiang Wang

unread,
Jan 17, 2025, 7:54:11 AM1/17/25
to deal.II User Group
Dear Deal.II community,


I install deal.II package through 
'''
sudo -i

export REPO=ppa:ginggs/deal.ii-XXX-backports

apt-get update && apt-get install -y software-properties-common
add-apt-repository $REPO
apt-get update
apt-get install libdeal.ii-dev
apt-get install build-essential cmake ninja-build gdb git-core
'''

I'd like to ask if you know how to compile deal.II test file, say, tests/base/quadrature_point_data.cc.

Thanks a lot in advance.

Best regards,

Junxiang.

Wolfgang Bangerth

unread,
Jan 17, 2025, 6:03:01 PM1/17/25
to dea...@googlegroups.com
On 1/17/25 05:54, Junxiang Wang wrote:
>
> I'd like to ask if you know how to compile deal.II test file, say,
> tests/base/quadrature_point_data.cc
> <https://github.com/dealii/dealii/blob/master/tests/base/quadrature_point_data.cc>.

It is generally quite a lot of work to get individual files to compile from
scratch because you need to know where the deal.II headers are located, how
exactly to link to deal.II and all of the dependencies, what compiler flags
are necessary, etc.

As a consequence, the right approach is to use the CMakeLists.txt files that
come, for example, with the deal.II tutorial programs and use those to compile
programs. You may want to locate where 'apt-get' has installed the deal.II
tutorials, and then copy an entire directory (say step-1) to your home
directory where you can then call 'cmake' in that directory to set up all the
necessary steps.

Best
W.

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


Junxiang Wang

unread,
Jan 20, 2025, 1:17:16 AM1/20/25
to deal.II User Group
Dear Prof.  Bangerth 

Thanks a lot for your advice.

I successfully compiled the test code snippets.

Best Regards,

Junxiang.

Reply all
Reply to author
Forward
0 new messages