Skip to content

Install issue olb-1.5r0

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #6543
    hungryfish
    Participant

    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/bin

    olb-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 2

    #6544
    Adrian
    Keymaster

    Unfortunately 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 3 months ago by Adrian.
    #6548
    hungryfish
    Participant

    Thanks 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_64

    #6549
    Adrian
    Keymaster

    In 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

    #6550
    hungryfish
    Participant

    [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 9

    #6556
    hungryfish
    Participant

    For 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

    #6557
    mathias
    Keymaster

    Yes, we will have wlan! Best Mathias

    #6567
    at8i
    Participant

    Hello,
    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).

    #6569
    Adrian
    Keymaster

    You 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?

    #6583
    at8i
    Participant

    Hello,
    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.

    #6594
    Adrian
    Keymaster

    Unfortunately 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?

    #6613
    at8i
    Participant

    Hello 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,
    Amir

    #6615
    mathias
    Keymaster

    Dear 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
    Mathias

    #6616
    at8i
    Participant

    Dear Mathias,
    The solution works for me thank you. There was no problem.
    Best regards,
    Amir

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.