linking/include from autoibamr

15 views
Skip to first unread message

adka...@gmail.com

unread,
Jun 23, 2025, 2:46:28 PMJun 23
to IBAMR Users
Hi all, 

After years of using configure, I am trying to swap to using autoibamr, but when compiling my application the makefile generated by cmake is not finding include files:
        fatal error: IBAMR_config.h: No such file or directory
        33 | #include <IBAMR_config.h>
What include statements would I add to the CMakeLists.txt file accordingly?   

Running cmake passes, it's the make step that fails. Autoibamr installed fine after loading, for whatever reason,  the libevent/2.1.12 module and a few other expected path/module settings. The IBFE example files do compile and run. The CMakeLists.txt file based on the example on https://ibamr.github.io/linking follows. 

Thank you, 
Alex 


$ cat CMakeLists.txt
PROJECT(mysolver)
CMAKE_MINIMUM_REQUIRED(VERSION 3.15.0)

# List your source files here
SET(SOURCE_FILES main.cpp
CirculationModel_aorta.cpp
boundary_condition_util.cpp
FourierBodyForce.cpp
pnpoly.cpp
FeedbackForcer.cpp)
ADD_EXECUTABLE(main_aorta ${SOURCE_FILES})

FIND_PACKAGE(IBAMR 0.16.0 REQUIRED)
TARGET_LINK_LIBRARIES(main_aorta IBAMR::IBAMR3d)
# IBAMR saves the flags it used to compile - you can reuse them if you want to
SET(CMAKE_CXX_FLAGS ${IBAMR_CXX_FLAGS})

Boyce Griffith

unread,
Jun 23, 2025, 2:50:38 PMJun 23
to IBAMR Users
On Jun 23, 2025, at 2:46 PM, adka...@gmail.com <adka...@gmail.com> wrote:

Hi all, 

After years of using configure, I am trying to swap to using autoibamr, but when compiling my application the makefile generated by cmake is not finding include files:
        fatal error: IBAMR_config.h: No such file or directory
        33 | #include <IBAMR_config.h>
What include statements would I add to the CMakeLists.txt file accordingly?   

You no longer need to #include IBAMR_config.h with the CMake-based build system. Try removing that line and see if it works.

(David, I have completely forgotten if we discussed this, but would it make sense to include a compatibility header that prints a deprecation warning?)

— Boyce

Running cmake passes, it's the make step that fails. Autoibamr installed fine after loading, for whatever reason,  the libevent/2.1.12 module and a few other expected path/module settings. The IBFE example files do compile and run. The CMakeLists.txt file based on the example on https://ibamr.github.io/linking follows. 

Thank you, 
Alex 


$ cat CMakeLists.txt
PROJECT(mysolver)
CMAKE_MINIMUM_REQUIRED(VERSION 3.15.0)

# List your source files here
SET(SOURCE_FILES main.cpp
CirculationModel_aorta.cpp
boundary_condition_util.cpp
FourierBodyForce.cpp
pnpoly.cpp
FeedbackForcer.cpp)
ADD_EXECUTABLE(main_aorta ${SOURCE_FILES})

FIND_PACKAGE(IBAMR 0.16.0 REQUIRED)
TARGET_LINK_LIBRARIES(main_aorta IBAMR::IBAMR3d)
# IBAMR saves the flags it used to compile - you can reuse them if you want to
SET(CMAKE_CXX_FLAGS ${IBAMR_CXX_FLAGS})

--
You received this message because you are subscribed to the Google Groups "IBAMR Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibamr-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ibamr-users/6688b5cb-ab82-43cb-91b5-aa4f8c862702n%40googlegroups.com.

Alex Kaiser

unread,
Jun 23, 2025, 3:06:56 PMJun 23
to ibamr...@googlegroups.com
Hi Boyce, 

That worked for that error, thank you. Now it's having trouble finding silo headers (fatal error: silo.h: No such file or directory). What should be done to link with that, some other include to cmake? 

To include it currently I do 
#if defined(IBAMR_HAVE_SILO)
#include <silo.h>
#endif
Silo does appear in autoibamr/configuration, so it appears building it worked fine. 

Thank you, 
Alex 



You received this message because you are subscribed to a topic in the Google Groups "IBAMR Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ibamr-users/aULy5Cja0z8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ibamr-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ibamr-users/BE9528A3-6C67-4920-8FE3-5726D981DE61%40gmail.com.

Boyce Griffith

unread,
Jun 23, 2025, 3:17:33 PMJun 23
to IBAMR Users

On Jun 23, 2025, at 3:06 PM, Alex Kaiser <adka...@gmail.com> wrote:

Hi Boyce, 

That worked for that error, thank you. Now it's having trouble finding silo headers (fatal error: silo.h: No such file or directory). What should be done to link with that, some other include to cmake? 

To include it currently I do 
#if defined(IBAMR_HAVE_SILO)
#include <silo.h>
#endif
Silo does appear in autoibamr/configuration, so it appears building it worked fine. 

I am surprised that one is not working. I guess that IBAMR_HAVE_SILO is defined since you are hitting that error, so at least IBAMR thinks that silo should be available.

Are you directly calling Silo routines yourself?

Alex Kaiser

unread,
Jun 23, 2025, 3:30:45 PMJun 23
to ibamr...@googlegroups.com
I do not think so, just enabling silo output for the fiber-based Lagrangian structures. I have code like this that was propagated from some example file, but think those are not direct silo calls, though could be mistaken. 
        Pointer<LSiloDataWriter> silo_data_writer = app_initializer->getLSiloDataWriter();
        if (uses_visit)
        {
            ib_initializer->registerLSiloDataWriter(silo_data_writer);
            ib_method_ops->registerLSiloDataWriter(silo_data_writer);
            time_integrator->registerVisItDataWriter(visit_data_writer);
        }

Thank you, 
Thank you, 

Boyce Griffith

unread,
Jun 23, 2025, 3:34:15 PMJun 23
to IBAMR Users

On Jun 23, 2025, at 3:30 PM, Alex Kaiser <adka...@gmail.com> wrote:

I do not think so, just enabling silo output for the fiber-based Lagrangian structures. I have code like this that was propagated from some example file, but think those are not direct silo calls, though could be mistaken. 
        Pointer<LSiloDataWriter> silo_data_writer = app_initializer->getLSiloDataWriter();
        if (uses_visit)
        {
            ib_initializer->registerLSiloDataWriter(silo_data_writer);
            ib_method_ops->registerLSiloDataWriter(silo_data_writer);
            time_integrator->registerVisItDataWriter(visit_data_writer);
        }

If you don’t make any of your own calls to SILO functions, you should be able to omit the #include <silo.h> directive. (Although it should work if you were to #include it…)

— Boyce

Wells, David

unread,
Jun 23, 2025, 4:23:36 PMJun 23
to IBAMR Users
Hi Alex and Boyce,

IBAMR_config.h has been deprecated for five years (ever since we first supported cmake) - it was never necessary for external applications to include it (unless they are doing something unusual, like checking version numbers) and the modern replacement is ibamr/config.h (which is included by every IBAMR header, so, similarly, no external application ever needs to explicitly include it). The main problem with IBAMR_config.h (and also IBTK_config.h) is that it isn't placed one of the header subdirectories. Hence, there's no good way to install it, so it isn't present when compiling IBAMR with cmake, but it is still present (and prints warnings) when you compile IBAMR with autotools.

We presently don't export silo's header directories since SILO is only used internally by the library. You could add the directory in yourself in the normal way in cmake, but it isn't necessary with IBAMR. Based on your code I don't think you are directly using any SILO functions so it should be OK to unconditionally remove that inclusion.

Best,
David Wells

From: ibamr...@googlegroups.com <ibamr...@googlegroups.com> on behalf of Boyce Griffith <boy...@gmail.com>
Sent: Monday, June 23, 2025 3:33 PM
To: IBAMR Users <ibamr...@googlegroups.com>
Subject: Re: [ibamr-users] linking/include from autoibamr
 

Alex Kaiser

unread,
Jun 23, 2025, 5:21:28 PMJun 23
to ibamr...@googlegroups.com
Hi David and Boyce, 

Removed those and all seems to compile now, thank you. Yes, I'm well behind on versions. Apologies, I typically update all at once between projects, but had overlapping projects and also broke some other bits of code compatibility, so I'm just finally getting to updating properly now.  I'm not sure why or when I added that include for the silo functions, but it seems fine without it. Removing these headers also compiles with the old configure build. 

Thank you, 
Alex 

Wells, David

unread,
Jun 24, 2025, 8:39:16 AMJun 24
to ibamr...@googlegroups.com
Hi Alex,

I'm glad to hear things worked (and that the changes required for cmake are backwards-compatible). Let us know if anything else comes up!

Best,
David

From: ibamr...@googlegroups.com <ibamr...@googlegroups.com> on behalf of Alex Kaiser <adka...@gmail.com>
Sent: Monday, June 23, 2025 5:20 PM
To: ibamr...@googlegroups.com <ibamr...@googlegroups.com>

Subject: Re: [ibamr-users] linking/include from autoibamr
 
You don't often get email from adka...@gmail.com. Learn why this is important
Reply all
Reply to author
Forward
0 new messages