Creating CMakeLists for autoibamr installation

53 views
Skip to first unread message

Keerthi Anand

unread,
Jul 28, 2022, 2:28:21 PM7/28/22
to IBAMR Users
Hello,

I reinstalling IBAMR using autoibamr and have trouble recompiling executables for my older IIM simulations.
 I followed instructions on  https://ibamr.github.io/linking and tried to modify create cmake lists to the following:

PROJECT(mysolver)
CMAKE_MINIMUM_REQUIRED(VERSION 3.15.0)
ADD_EXECUTABLE(main3d main.cpp FeedbackForcer.cpp VelocityBcCoefs.cpp)
FIND_PACKAGE(IBAMR 0.11.0 REQUIRED)
TARGET_LINK_LIBRARIES(main3d 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})

However, when I run the command :

cmake -DIBAMR_ROOT="${IBAMR_ROOT}" .

CMakeFiles folder is generated, but not my main3d file.

Below are the contents of the makefile I used with my prior installation of IBAMR when it was setup with ./configure 

include $(IBAMR_BUILD_DIR)/config/make.inc

###############################################################
#Build the application.

SRC = $(wildcard *.cpp)
CPPFLAGS += -MD -MP
PDIM = 3
OBJS = $(SRC:%.cpp=%.o) $(IBAMR_LIB_3D) $(IBTK_LIB_3D)
main3d: $(OBJS)
    $(CXX) $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -DNDIM=$(PDIM) -o $@
-include $(SRC:%.cpp=%.d)

What am I missing in the CMakeList?

Thanks,
Keerthi


Wells, David

unread,
Jul 28, 2022, 2:54:59 PM7/28/22
to IBAMR Users
Hi Keerthi,

CMake is a build system generator - it created a makefile for you. Type

make

in the terminal window and that will build the project (much like "./configure ; make" for autotools)

Best,
David

From: ibamr...@googlegroups.com <ibamr...@googlegroups.com> on behalf of Keerthi Anand <sais...@gmail.com>
Sent: Thursday, July 28, 2022 2:28 PM
To: IBAMR Users <ibamr...@googlegroups.com>
Subject: [ibamr-users] Creating CMakeLists for autoibamr installation
 
You don't often get email from sais...@gmail.com. Learn why this is important
--
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 on the web visit https://groups.google.com/d/msgid/ibamr-users/7803dff2-e23f-4619-9bab-bf298d7e86afn%40googlegroups.com.

Keerthi Anand

unread,
Jul 28, 2022, 3:32:36 PM7/28/22
to IBAMR Users
Thank You, This works!
Reply all
Reply to author
Forward
0 new messages