Install issue olb-1.5r0
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Install issue olb-1.5r0
- This topic has 13 replies, 4 voices, and was last updated 2 years, 8 months ago by at8i.
-
AuthorPosts
-
May 6, 2022 at 10:53 am #6543hungryfishParticipant
During initial ‘make’ I got
./tinystr.h:89:58: error: use of undeclared identifier ‘nullptr’
lindne03@i84177-4 olb-1.5r0 % gcc –version
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/binolb-1.5r0 % make
/Library/Developer/CommandLineTools/usr/bin/make -C external
make -C zlib
cc -c -o build/adler32.o ./adler32.c
cc -c -o build/crc32.o ./crc32.c
cc -c -o build/deflate.o ./deflate.c
cc -c -o build/infback.o ./infback.c
cc -c -o build/inffast.o ./inffast.c
cc -c -o build/inflate.o ./inflate.c
cc -c -o build/inftrees.o ./inftrees.c
cc -c -o build/trees.o ./trees.c
cc -c -o build/zutil.o ./zutil.c
cc -c -o build/compress.o ./compress.c
cc -c -o build/uncompr.o ./uncompr.c
cc -c -o build/gzclose.o ./gzclose.c
cc -c -o build/gzlib.o ./gzlib.c
cc -c -o build/gzread.o ./gzread.c
cc -c -o build/gzwrite.o ./gzwrite.c
ar rc build//libz.a ./build/adler32.o ./build/crc32.o ./build/deflate.o ./build/infback.o ./build/inffast.o ./build/inflate.o ./build/inftrees.o ./build/trees.o ./build/zutil.o ./build/compress.o ./build/uncompr.o ./build/gzclose.o ./build/gzlib.o ./build/gzread.o ./build/gzwrite.o
cp zlib/build/libz.a lib/
make -C tinyxml
c++ -c tinystr.cpp -o build/tinystr.o
In file included from tinystr.cpp:32:
./tinystr.h:82:50: error: use of undeclared identifier ‘nullptr’
TiXmlString ( const TiXmlString & copy) : rep_(nullptr)
^
./tinystr.h:89:58: error: use of undeclared identifier ‘nullptr’
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(nullptr)
^
./tinystr.h:96:72: error: use of undeclared identifier ‘nullptr’
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(nullptr)
^
3 errors generated.
make[2]: *** [build/tinystr.o] Error 1
make[1]: *** [tinyxml] Error 2
make: *** [dependencies] Error 2May 6, 2022 at 10:59 am #6544AdrianKeymasterUnfortunately this is a known issue when using the default compiler setup on Mac OS.
What does work according to a student of mine who works on Apple:
– Use Homebrew to install tinyxml, zlib and GCC, set
USE_EMBEDDED_DEPENDENCIES := OFF
, adapt compiler paths to not use the Apple-provided compilers (this will work for sequential mode but not for OpenMPI due to a general issue on MacOS)
– Use Nix to provide the entire shell and execution environment (works for parallel execution using MPI)We are currently working on a more detailed guide as we expect this same issue to come up in our upcoming Springschool. I will update this post once the guide is available.
- This reply was modified 2 years, 9 months ago by Adrian.
May 7, 2022 at 9:54 am #6548hungryfishParticipantThanks Adrian,
I repeated the same on an actual RedHat Linux, there are similar difficulties with ‘nullptr’
olb-1.5r0]$ make
make -C external
make[1]: Entering directory `/home2/lindne03/olb-1.5r0/external’
make -C zlib
make[2]: Entering directory `/home2/lindne03/olb-1.5r0/external/zlib’
cc -c -o build/adler32.o ./adler32.c
cc -c -o build/crc32.o ./crc32.c
cc -c -o build/deflate.o ./deflate.c
cc -c -o build/infback.o ./infback.c
cc -c -o build/inffast.o ./inffast.c
cc -c -o build/inflate.o ./inflate.c
cc -c -o build/inftrees.o ./inftrees.c
cc -c -o build/trees.o ./trees.c
cc -c -o build/zutil.o ./zutil.c
cc -c -o build/compress.o ./compress.c
cc -c -o build/uncompr.o ./uncompr.c
cc -c -o build/gzclose.o ./gzclose.c
cc -c -o build/gzlib.o ./gzlib.c
cc -c -o build/gzread.o ./gzread.c
cc -c -o build/gzwrite.o ./gzwrite.c
ar rc build//libz.a ./build/adler32.o ./build/crc32.o ./build/deflate.o ./build/infback.o ./build/inffast.o ./build/inflate.o ./build/inftrees.o ./build/trees.o ./build/zutil.o ./build/compress.o ./build/uncompr.o ./build/gzclose.o ./build/gzlib.o ./build/gzread.o ./build/gzwrite.o
make[2]: Leaving directory `/home2/lindne03/olb-1.5r0/external/zlib’
cp zlib/build/libz.a lib/
make -C tinyxml
make[2]: Entering directory `/home2/lindne03/olb-1.5r0/external/tinyxml’
g++ -c tinystr.cpp -o build/tinystr.o
In file included from tinystr.cpp:32:0:
tinystr.h: In copy constructor ‘TiXmlString::TiXmlString(const TiXmlString&)’:
tinystr.h:82:50: error: ‘nullptr’ was not declared in this scope
TiXmlString ( const TiXmlString & copy) : rep_(nullptr)
^
tinystr.h: In constructor ‘TiXmlString::TiXmlString(const char*)’:
tinystr.h:89:58: error: ‘nullptr’ was not declared in this scope
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(nullptr)
^
tinystr.h: In constructor ‘TiXmlString::TiXmlString(const char*, TiXmlString::size_type)’:
tinystr.h:96:72: error: ‘nullptr’ was not declared in this scope
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(nullptr)
^
make[2]: *** [build/tinystr.o] Error 1
make[2]: Leaving directory `/home2/lindne03/olb-1.5r0/external/tinyxml’
make[1]: *** [tinyxml] Error 2
make[1]: Leaving directory `/home2/lindne03/olb-1.5r0/external’
make: *** [dependencies] Error 2
[lindne03@e84158 olb-1.5r0]$olb-1.5r0]$ rpm -qa | grep tiny
tinyxml-2.6.2-3.el7.x86_64May 7, 2022 at 10:00 am #6549AdrianKeymasterIn this case the GCC version is too old also on the Red Head system. What does “g++ -v” return?
We need at least GCC 9.
System provided tinyxml will only be used if “USE_EMBEDDED_DEPENDENCIES := OFF” is set in config.mk
May 7, 2022 at 10:33 am #6550hungryfishParticipant[lindne03@e84158 olb-1.5r0]$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –with-bugurl=http://bugzilla.redhat.com/bugzilla –enable-bootstrap –enable-shared –enable-threads=posix –enable-checking=release –with-system-zlib –enable-__cxa_atexit –disable-libunwind-exceptions –enable-gnu-unique-object –enable-linker-build-id –with-linker-hash-style=gnu –enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto –enable-plugin –enable-initfini-array –disable-libgcj –with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install –with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install –enable-gnu-indirect-function –with-tune=generic –with-arch_32=x86-64 –build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)I adjusted USE_EMBEDDED_DEPENDENCIES accordingly.
ok
I try to provide gcc 9May 9, 2022 at 3:25 pm #6556hungryfishParticipantFor the RedHat7 the devtoolset-10 environment is a suitable environment.
poiseuille2d]$ gcc –version
gcc (GCC) 10.2.1 20200804 (Red Hat 10.2.1-2)I was able to compile an run
[simulatePoiseuille] Simulation converged.
[Timer] step=46192; percent=61.5893; passedTime=21.509; remTime=13.4143; MLUPs=9.69983
[LatticeStatistics] step=46192; t=18.4768; uMax=0.0199918; avEnergy=0.000104468; avRho=1
[error] velocity-L1-error(abs)=0.00081448; velocity-L1-error(rel)=0.000605054
[error] velocity-L2-error(abs)=0.000578884; velocity-L2-error(rel)=0.000557721
[error] velocity-Linf-error(abs)=0.000411441; velocity-Linf-error(rel)=0.000411441
[error] strainRate-L1-error(abs)=0.00121289; strainRate-L1-error(rel)=0.00031273
[error] strainRate-L2-error(abs)=0.00108305; strainRate-L2-error(rel)=0.000481107
[error] strainRate-Linf-error(abs)=0.0019656; strainRate-Linf-error(rel)=0.00102375
[Timer]
[Timer] —————-Summary:Timer—————-
[Timer] measured time (rt) : 21.523s
[Timer] measured time (cpu): 21.460s
[Timer] average MLUPs : 11.055
[Timer] average MLUPps: 11.055
[Timer] ———————————————
[lindne03@e84158 poiseuille2d]$and
At Spring School wil be WLAN possible for each participant?Thanks
May 9, 2022 at 3:53 pm #6557mathiasKeymasterYes, we will have wlan! Best Mathias
May 14, 2022 at 11:09 pm #6567at8iParticipantHello,
I could not set everything properly in mine for tinyxml.(I did do all that was suggested. I am pretty sure I am messing up something). An alternative that is working for me is Multipass. Use primary to install what is necessary and compile. (Share your Open LB directory).May 16, 2022 at 8:52 pm #6569AdrianKeymasterYou should not need to change anything for tinyxml if the compiler setup is up to date. This is only a workaround on some configs where the environment supports C++17 to the degree that OpenLB (where we mostly use language features and not so much library features) compiles but the compiler used for tinyxml doesn’t support even C++11 (e.g. g++ resolved to old clang under Mac OS).
Did you try compiling OpenLB with an unchanged default config.mk and GCC version >= 9? If it fails: What is the specific error?
May 25, 2022 at 6:39 pm #6583at8iParticipantHello,
This is the error I get when I try compiling without any change in configuration.
‘
make -C zlib
cc -c -o build/adler32.o ./adler32.c
cc -c -o build/crc32.o ./crc32.c
cc -c -o build/deflate.o ./deflate.c
cc -c -o build/infback.o ./infback.c
cc -c -o build/inffast.o ./inffast.c
cc -c -o build/inflate.o ./inflate.c
cc -c -o build/inftrees.o ./inftrees.c
cc -c -o build/trees.o ./trees.c
cc -c -o build/zutil.o ./zutil.c
cc -c -o build/compress.o ./compress.c
cc -c -o build/uncompr.o ./uncompr.c
cc -c -o build/gzclose.o ./gzclose.c
cc -c -o build/gzlib.o ./gzlib.c
cc -c -o build/gzread.o ./gzread.c
cc -c -o build/gzwrite.o ./gzwrite.c
ar rc build//libz.a ./build/adler32.o ./build/crc32.o ./build/deflate.o ./build/infback.o ./build/inffast.o ./build/inflate.o ./build/inftrees.o ./build/trees.o ./build/zutil.o ./build/compress.o ./build/uncompr.o ./build/gzclose.o ./build/gzlib.o ./build/gzread.o ./build/gzwrite.o
cp zlib/build/libz.a lib/
make -C tinyxml
c++ -c tinystr.cpp -o build/tinystr.o
In file included from tinystr.cpp:32:
./tinystr.h:82:50: error: use of undeclared identifier ‘nullptr’
TiXmlString ( const TiXmlString & copy) : rep_(nullptr)
^
./tinystr.h:89:58: error: use of undeclared identifier ‘nullptr’
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(nullptr)
^
./tinystr.h:96:72: error: use of undeclared identifier ‘nullptr’
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(nullptr)
^
3 errors generated.
make[2]: *** [build/tinystr.o] Error 1
make[1]: *** [tinyxml] Error 2
make: *** [dependencies] Error 2
‘Changing the default compiler path to other ones and also installing tinyxml, zlib and GCC and setting ‘USE_EMBEDDED_DEPENDENCIES := OFF’ resulted in the same error. I think I am not correctly making adjustment to compiler path.
I will try and solve the problem if I have the time, right now the Multipass is just another terminal which I compile everything after making changes, a bit of a hassle but not a really annoying one.
May 30, 2022 at 8:45 am #6594AdrianKeymasterUnfortunately the CXX value in config.mk is not passed to the embedded dependency builds in the release version. You need to override it using e.g.
export CXX=...
if the default compiler is too old (i.e. in this case doesn’t support even C++11).Alternatively, as you already installed tinyxml and zlib separately and disabled
USE_EMBEDDED_DEPENDENCIES
, you can directly compile the example you want to execute (switch to example folder, run make).make
in the OpenLB root only compiles those dependencies which is why you still get the error there.For further support, I’ll need to see the specific config-mk file and your exact compiler environment. But I suspect that compiling the examples directly / overriding CXX will already help.
Out of general interest: What is your usecase of Multipass in this context?
June 3, 2022 at 9:47 am #6613at8iParticipantHello Adrian,
Thank you for your reply Adrian. I did export env variable in my shell. but the macOS gave me weird errors regarding accessibility and such. (was not able to access that specific compiler I installed and etc. I used sudo too.).
I was trying to compile everything. I was silly not to try and run make from example folders duh!. Most likely should have been enough to generate the file I needed.I will try that. I am using Multipass to compile and run everything in openLB folder which is the only folder shared with Virtual Ubuntu.
Just install GCC and openmpi dependencies and you should be able to compile everything. I am using compiledb to generate compile_commands.json and using to hop around the library.Of course, there is no need for you to do so if your IDE can do it for you. But mine does not so I usually need that. Afterwards for me it takes a long time to write something which is worth trying running it. But I compile it on Multipass to make sure the changes I made were correct compile-error wise. Nothing more than that. I don’t have access to workstations to give you any information about the compatibility of them and Multipass. I hope this answer is of use.
Best regards,
AmirJune 3, 2022 at 10:12 am #6615mathiasKeymasterDear Amir,
Maybe that helps https://www.openlb.net/tech-reports/
TR6: Configuring OpenLB on MacOS
Explaining how to configure OpenLB on MacOS. It has been tested with OpenLB v. 1.5 using MacOS 11.6. olb-tr6.pdf.Best
MathiasJune 3, 2022 at 11:22 am #6616at8iParticipantDear Mathias,
The solution works for me thank you. There was no problem.
Best regards,
Amir -
AuthorPosts
- You must be logged in to reply to this topic.