Whether the 3D-Makefile works for all 3D examples?

84 views
Skip to first unread message

Dewu Yang

unread,
May 19, 2022, 7:11:37 AM5/19/22
to IBAMR Users
Dear all,
When I complie 3D examples using makefile (https://ibamr.github.io/linking), most of the 3D examples would compile normally, but the eel3d example would never compile. What is the reason? Here are the contents of my makefile:
##################################################################
IBAMR_SRC_DIR   = /home/yangdewu/sfw/ibamr/IBAMR
IBAMR_BUILD_DIR = /home/yangdewu/sfw/ibamr/ibamr-objs-opt

Include variables specific to the particular IBAMR build.
include $(IBAMR_BUILD_DIR)/config/make.inc


ifdef XCODE_VERSION_ACTUAL
CXXFLAGS += -fno-color-diagnostics
endif


SRC = $(wildcard *.cpp)
CPPFLAGS += -MD -MP
PDIM = 3
OBJS = $(SRC:%.cpp=%.o) $(IBAMR_LIB_3D) $(IBTK_LIB_3D)

main3d: $(OBJS)
    $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -DNDIM=$(PDIM) -o main3d

clean:
    $(RM) main3d
    $(RM) *.o *.lo *.objs *.ii *.int.c
    $(RM) -r .libs

-include $(SRC:%.cpp=%.d)
//////////////////////////////////////////////////////////////////////////////////////////////////////////

Compilation errors occur as follows:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/usr/bin/ld: example.o: in function `main':
example.cpp:(.text.startup+0x950): multiple definition of `main'; eelgenerator3d.o:eelgenerator3d.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:28:main3d] Error 1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Do I need to change anything in the Makefile? I would appreciate it if you could give me some advice.
Best,
Dewu

Boyce Griffith

unread,
May 19, 2022, 8:34:40 AM5/19/22
to ibamr...@googlegroups.com

On May 19, 2022, at 7:11 AM, Dewu Yang <yangd...@gmail.com> wrote:

Dear all,
When I complie 3D examples using makefile (https://ibamr.github.io/linking), most of the 3D examples would compile normally, but the eel3d example would never compile. What is the reason? Here are the contents of my makefile:

It looks like you are compiling two different source code files that have a main routine, and then trying to link both of the resulting object code files into a single executable.

The sample Makefile that we provide is not very smart. It is set up to try to compile all files in the current directory with a .cpp suffix. (This is what “SRC = $(wildcard *.cpp)” does.) Could you have two different “main”s in that directory?

If you want to compile only specific source code files, change “SRC = $(wildcard *.cpp)” to “SRC = <list of .cpp files>”.

--
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/95883860-de85-4882-9eaa-3da49ae38100n%40googlegroups.com.

Dewu Yang

unread,
May 19, 2022, 11:18:20 AM5/19/22
to IBAMR Users
Thanks for your suggestion,  I'm sorry that I don't quite understand what “SRC = <list of .cpp files>” means. Does that mean just going to change it to this line of code or do I just list the specific code which I want to compile and put it in there? The eel3d example has one main program and two other .cpp files, one of which is the fish shape generating code (eelgenerator3d.cpp) that I have already complied in addition, so do I just put the other two files in the “SRC = "?

Best,
Dewu
2022-05-19_23-17.png

Amneet Bhalla

unread,
May 19, 2022, 11:24:39 AM5/19/22
to ibamr...@googlegroups.com
Hi Dewu,

The eelgenerator.cpp also has a separate main() routine. The example.cpp has main() as well. As per C/C++ rule there can be only one main() routine for an executable.

You can either remove eelgenerator.cpp from your directory or in Makefile specify

SRC = example.cpp IBEelkinematics.cpp


as the source files to compile.


--
--Amneet 



Dewu Yang

unread,
May 19, 2022, 8:38:18 PM5/19/22
to IBAMR Users
Dear prof.Amneet,

It's ready to compile, thanks a lot for your suggestion.

Best,
Dewu

Dewu Yang

unread,
May 22, 2022, 8:17:31 AM5/22/22
to IBAMR Users
Dear prof. Amneet and Griffith,
When I was drawing eel3d isosurface vortices, the size of trailing vortices suddenly is erratic. Is there something wrong with my Settings in VisIt or does the absolute threshold of the vorticity in the input3d file need to be changed (now use the original threshold in the code [1.0, 1.5, 2.0, 3.0])? I would appreciate it if you could give me some suggestions.
And here are my operating steps and the the attachment is the output result.

Add —> Pseudocolor —> Omega_magnitude —> Operators —> Slicing —> Isosurface

2022-05-22 17-53-17 的屏幕截图.png

Best,
Dewu
eel3d.mpg

Boyce Griffith

unread,
May 23, 2022, 10:05:48 AM5/23/22
to noreply-spamdigest via IBAMR Users

On May 22, 2022, at 8:17 AM, Dewu Yang <yangd...@gmail.com> wrote:

Dear prof. Amneet and Griffith,
When I was drawing eel3d isosurface vortices, the size of trailing vortices suddenly is erratic.

What does erratic mean? Is this something that happens when the vortices hit the domain boundary?

Is there something wrong with my Settings in VisIt or does the absolute threshold of the vorticity in the input3d file need to be changed (now use the original threshold in the code [1.0, 1.5, 2.0, 3.0])? I would appreciate it if you could give me some suggestions.
And here are my operating steps and the the attachment is the output result.

Add —> Pseudocolor —> Omega_magnitude —> Operators —> Slicing —> Isosurface

<2022-05-22 17- 53-17 的屏幕截图.png>

Best,
To view this discussion on the web visit https://groups.google.com/d/msgid/ibamr-users/963f0f4e-01ec-46ec-ac16-b1cabec1365fn%40googlegroups.com.
<2022-05-22 17- 53-17 的屏幕截图.png><eel3d.mpg>

Dewu Yang

unread,
May 23, 2022, 10:55:11 AM5/23/22
to IBAMR Users
The "erratic" means that the trailing vortices shed by fish are not natural to dissipate over time, but a change in size back and forth within a period, as the video file shows. The vortices in the video did not hit the domain boundary. I will try to reduce the absolute threshold of the vorticity to see if this will still happen.
Best,
Dewu

Boyce Griffith

unread,
May 23, 2022, 10:58:00 AM5/23/22
to noreply-spamdigest via IBAMR Users

On May 23, 2022, at 10:55 AM, Dewu Yang <yangd...@gmail.com> wrote:

The "erratic" means that the trailing vortices shed by fish are not natural to dissipate over time, but a change in size back and forth within a period, as the video file shows. The vortices in the video did not hit the domain boundary. I will try to reduce the absolute threshold of the vorticity to see if this will still happen.

Sorry, I missed the video in the original email.

I think that if you fix the min/max values, the pulsation will go away. VisIt is dynamically tracking the full range of values at each time instant, but this is not what you want for this kind of a visualization.

Dewu Yang

unread,
May 23, 2022, 10:31:16 PM5/23/22
to IBAMR Users
Thanks for your advice, but the pulsation still remains when I fix the min/max values. And  I changed the threshold and it didn't eliminate the pulsation, I will try modify other parameters in VisIt, perhaps the Pseudocolor option which I selected is not correct.
Best,
Dewu

Dewu Yang

unread,
May 25, 2022, 5:00:36 AM5/25/22
to IBAMR Users
I'm sorry that I misunderstood your suggestion. It is the min/max values of fixed isosurface, then the pulsation problem is solved. Thanks again for your advice.
Best,
Dewu

Boyce Griffith

unread,
May 25, 2022, 9:07:42 AM5/25/22
to noreply-spamdigest via IBAMR Users

On May 25, 2022, at 5:00 AM, Dewu Yang <yangd...@gmail.com> wrote:

I'm sorry that I misunderstood your suggestion. It is the min/max values of fixed isosurface, then the pulsation problem is solved. Thanks again for your advice.

Sorry that my suggestion was not clear — yes, I meant to fix the range of values in the isosurface plot to capture the features of interest. It is natural that the max/min vorticity on the grid go up/down as the swimmer swims.

Best,
Dewu

On Tuesday, May 24, 2022 at 10:31:16 AM UTC+8 Dewu Yang wrote:
Thanks for your advice, but the pulsation still remains when I fix the min/max values. And  I changed the threshold and it didn't eliminate the pulsation, I will try modify other parameters in VisIt, perhaps the Pseudocolor option which I selected is not correct.
Best,
Dewu

--
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.
Reply all
Reply to author
Forward
0 new messages