Re: [AMBER] Testing C++11 support: Not present

From: Gustaf Olsson <gustaf.olsson.lnu.se>
Date: Fri, 12 Oct 2018 07:54:13 +0000

So, I could not leave it alone. This is what I have done so far and what the output is.

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
sudo cp [PATH TO]/toiPhoneOS.sdk/libstdc++.* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
sudo cp [PATH TO]/toiPhoneSimulator.sdk/libstdc++.* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
./configure -macAccelerate clang

        Checking for updates...
        Checking for available patches online. This may take a few seconds...

        Available AmberTools 18 patches:

        No patches available


        AMBER_PREFIX=/amber18
        AMBER_SOURCE=/amber18

        Using the AmberTools miniconda installation in /amber18/miniconda
        version 2.7.13

        Obtaining the clang compiler suite versions, e.g.:
             clang -v
        The C version is 10.0.0
        The Fortran version is 8.2.0

        Testing the clang compiler:
             clang -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o testp testp.c
        OK

        Testing the clang++ compiler:
             clang++ -fPIC -o testp testp.cpp
        OK
        
        Testing the gfortran compiler:
             gfortran -fPIC -O0 -o testp testp.f
        OK

        Testing mixed C/Fortran compilation:
             clang -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -c -o testp.c.o testp.c
             gfortran -fPIC -O0 -c -o testp.f.o testp.f
             clang -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o testp testp.c.o testp.f.o -L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin18.0.0/8.2.0/../../../ -lgfortran -w -framework Accelerate
        OK

        Testing pointer size:
             clang -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o test_pointer_size test_pointer_size.c
        Detected 64 bit operating system.

        Testing flex: OK

        Checking NetCDF...
                Using bundled NetCDF library.
                Using existing NetCDF in '/amber18'

        Checking for zlib: OK

        Checking for libbz2: OK

        Testing the clang++ compiler with boost:
             clang++ -fPIC testp.cpp -lboost_thread -lboost_system -o testp

        Warning: Could not link to boost. Ensure boost-thread, boost-system and boost headers are installed.
        Warning: Failed command:
             clang++ -fPIC -lboost_thread -lboost_system -o testp testp.cpp
        Warning: Check boost.compile.err for error details.
        Warning: Memembed functionality in packmol_memgen not available.
        
        Configuring fftw-3.3 (may be time-consuming)...

            fftw-3.3 configure succeeded.

        Configuring XBLAS (may be time-consuming)...

            XBLAS configure succeeded.

        Configuring CPPTRAJ...
        CPPTRAJ configure failed. Check '/amber18/AmberTools/src/cpptraj_config.log' for details.
        Configure failed due to the errors above!

                  fftw3 enabled.
                  fftw3 specified: /amber18
                  sanderlib specified: /amber18
                  netcdf specified: /amber18
                  arpack specified: /amber18
                  Testing C++11 support: Not present
                Error: Could not link properly with clang++ on OSX

PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
./configure -macAccelerate clang

        Configuring CPPTRAJ...
        CPPTRAJ configure failed. Check '/amber18/AmberTools/src/cpptraj_config.log' for details.
        Configure failed due to the errors above!

sudo cp ~/Desktop/MojaveCLANG_Fix/toiPhoneOS.sdk/libstdc++.* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/usr/lib/
sudo cp ~/Desktop/MojaveCLANG_Fix/toiPhoneSimulator.sdk/libstdc++.* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/lib/
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.sdk/usr/lib
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk/usr/lib/
./configure -macAccelerate clang

        Configuring CPPTRAJ...
        CPPTRAJ configure failed. Check '/amber18/AmberTools/src/cpptraj_config.log' for details.
        Configure failed due to the errors above!

No luck so far.... Reload terminal session, new and fresh, remove amber18 and re-extract, all clean

./configure -macAccelerate clang

        Configuring CPPTRAJ...
        CPPTRAJ configure failed. Check '/amber18/AmberTools/src/cpptraj_config.log' for details.
        Configure failed due to the errors above!

./configure clang

        Configuring CPPTRAJ...
        CPPTRAJ configure failed. Check '/amber18/AmberTools/src/cpptraj_config.log' for details.
        Configure failed due to the errors above!

ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc
ln -s /usr/local/bin/g++-8 /usr/local/bin/g++
ln -s /usr/local/bin/c++-8 /usr/local/bin/c++
./configure gnu

        Checking for updates...
        Checking for available patches online. This may take a few seconds...

        Available AmberTools 18 patches:

        No patches available


        AMBER_PREFIX=/amber18/
        AMBER_SOURCE=/amber18/

        Using the AmberTools miniconda installation in /amber18//miniconda
        version 2.7.13

        Obtaining the gnu compiler suite versions, e.g.:
             gcc -v
        The C version is 8.2.0
        The Fortran version is 8.2.0

        Testing the gcc compiler:
             gcc -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o testp testp.c
        OK

        Testing the g++ compiler:
             g++ -fPIC -o testp testp.cpp
        OK

        Testing the gfortran compiler:
             gfortran -fPIC -O0 -o testp testp.f
        OK

        Testing mixed C/Fortran compilation:
             gcc -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -c -o testp.c.o testp.c
             gfortran -fPIC -O0 -c -o testp.f.o testp.f
             gcc -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o testp testp.c.o testp.f.o -lgfortran -w
        OK

        Testing pointer size:
             gcc -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o test_pointer_size test_pointer_size.c
        Detected 64 bit operating system.

        Testing flex: OK
        
        Checking NetCDF...
                Using bundled NetCDF library.
                Using existing NetCDF in '/amber18/'

        Checking for zlib: OK

        Checking for libbz2: OK

        Testing the g++ compiler with boost:
             g++ -fPIC testp.cpp -lboost_thread -lboost_system -o testp

        Warning: Could not link to boost. Ensure boost-thread, boost-system and boost headers are installed.
        Warning: Failed command:
             g++ -fPIC -lboost_thread -lboost_system -o testp testp.cpp
        Warning: Check boost.compile.err for error details.
        Warning: Memembed functionality in packmol_memgen not available.

        Configuring fftw-3.3 (may be time-consuming)...

            fftw-3.3 configure succeeded.

        Configuring XBLAS (may be time-consuming)...

            XBLAS configure succeeded.

        Configuring CPPTRAJ...complete.

        The configuration file, config.h, was successfully created.

        --------------------------------------------------------------------------------
        Environment resource files are provided to set the proper environment
        variables to use AMBER and AmberTools. This is required to run any Python
        programs (like MMPBSA.py, ParmEd, MCPB.py, and pytraj)

        If you use a Bourne shell (e.g., bash, sh, zsh, etc.), source the
        /amber18//amber.sh file in your shell. Consider adding the line
          test -f /amber18//amber.sh && source /amber18//amber.sh
        to your startup file (e.g., ~/.bashrc)

        If you use a C shell (e.g., csh, tcsh), source the
        /amber18//amber.csh file in your shell. Consider adding the line
          test -f /amber18//amber.csh && source /amber18//amber.csh
        to your startup file (e.g., ~/.cshrc)

        NOTE: MacOS users might need to add the content to ~/.bash_profile file
        (You need to do the above before running 'make install')
        --------------------------------------------------------------------------------

        The next step is to source the amber.sh or amber.csh file
          (if needed, see above), and then to type 'make install'

        Cleaning the src directories. This may take a few moments.
        Configure complete.

make install

No luck again...

        warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
        In file included from src/_rdparm.cpp:17:
        /amber18/AmberTools/src/parmed/src/readparm.h:5:10: fatal error: 'locale' file not found
        #include <locale>
                 ^~~~~~~~
        1 warning and 1 error generated.
        error: command 'clang' failed with exit status 1
        make[2]: *** [parmed] Error 1
        make[1]: *** [serial] Error 2
        make: *** [install] Error 2

So this is apparently still the issue, stdlibc++ is not available even if I have copied the appropriate files as suggested.

PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
PATH=$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

make install

        warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
        In file included from src/_rdparm.cpp:17:
        /amber18/AmberTools/src/parmed/src/readparm.h:5:10: fatal error: 'locale' file not found
        #include <locale>
                 ^~~~~~~~
        1 warning and 1 error generated.
        error: command 'clang' failed with exit status 1
        make[2]: *** [parmed] Error 1
        make[1]: *** [serial] Error 2
        make: *** [install] Error 2

I am obviously not going to solve this by hammering on it like this.

Best regards
// Gustaf

> On 12 Oct 2018, at 08:28, Gustaf Olsson <gustaf.olsson.lnu.se> wrote:
>
> Hello again, sorry I have been teaching classes all week!
>
> Here we go:
>
> clang++ -O3 -o testp testprogram.cpp
>
> No messages, no errors.
>
> ./testp
> $ Testing
>
> So far so good
>
> clang++ -O3 -std=c++11 -o testp testprogram.cpp
>
> No messages, no errors.
>
> ./testp
> $ Testing
>
> Onwards and upwards
>
> clang++ -O3 -stdlib=libstdc++ -o testp testprogram.cpp
>
> And bom goes the dynamite:
>
> clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated]
> warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the
> command line to use the libc++ standard library instead
> [-Wstdlibcxx-not-found]
> testprogram.cpp:1:10: fatal error: 'cstdio' file not found
> #include <cstdio>
> ^~~~~~~~
> 1 warning and 1 error generated.
>
> I saw Andrew Schaubs response as well stating the following:
>
> StackExchange referenced twitter about libstdc++ and it's removal from
> Xcode 10.0. The suggested work around was to install Xcode 9.4, and simply
> copy the folders over:
>
> cp
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.*
> /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
> cp
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.*
> /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
>
> "PSA: libstdc++ is gone from the iOS 12.0 SDK (it is present in the runtime
> for binary compatibility). It's days are numbered on macOS as well. Migrate
> over to libc++ if you haven't already. #WWDC2018 #cplusplus" .jeremyhu
> https://stackoverflow.com/questions/50694822/xcode-10-ios-12-does-not-contain-libstdc6-0-9
>
> https://twitter.com/jeremyhu/status/1003882060556062720
>
> So obviously the libstdc++ is the issue. It should be replaced using libc++ instead, which I assume is a bunch of work. The workaround that Andrew provided might actually work, I do have my backups from where I could just pull the lib file/files i need. I will most likely try this since I have a hard time not leaving things undone though this is not a solution for the mac-related issues obviously.
>
> Thank you everyone for you help and input, I really enjoy posting to the AMBER forum since there is always good people providing excellent support here!
>
> Best regards
> // Gustaf
>
> On 10 Oct 2018, at 15:52, Daniel Roe <daniel.r.roe.gmail.com<mailto:daniel.r.roe.gmail.com>> wrote:
>
> clang++ -O3 -o testp testprogram.cpp
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Oct 12 2018 - 01:00:02 PDT
Custom Search