New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #74 osx clang problems #732

Merged
merged 8 commits into from May 24, 2017

Conversation

Projects
None yet
3 participants
@heplesser
Contributor

heplesser commented May 23, 2017

This PR fixes problems that made NEST fails when built with Clang under OSX. I have tested with everything (except MPI) enabled under OSX 10.12.5 with Clang 4.0.0 from brew as described here (but with Python).

Problems where of several kinds:

  • When building static libraries, duplicate definitions of Name objects in nestkernel and topology prevented linking; the duplicates are removed from topology_names.*.
  • The ctermid() system function call from sli/processes.cc was called with an incorrectly sized output buffer.
  • Output file buffers in recording_device.* were not set up properly.
  • Explicit template instantiations of lockPTRDatum types are required to make these Datum types visible to PyNEST; clang and gcc seem to have different rules on symbol visibility.

I have tested with clang and gcc 7.1.0.

@flinz

flinz approved these changes May 24, 2017

Looks good to me!

Tested locally in XCode clang version 3.6.2 & Apple LLVM version 8.0.0 (clang-800.0.42.1), all tests seem to pass now.

@tammoippen

This comment has been minimized.

Show comment
Hide comment
@tammoippen

tammoippen May 24, 2017

Contributor

Working on macOS 10.12.5 (16F73)

I test some compilers for the default configurations. Seems good so far - all are building and tests are passing.

There are some compiler warnings, though:

/Users/tammoippen/Desktop/nest-simulator/models/noise_generator.cpp:182:5: warning: field 'S_' will be initialized after field 'B_' [-Wreorder]
  , S_()
    ^
/Users/tammoippen/Desktop/nest-simulator/models/noise_generator.cpp:196:5: warning: field 'S_' will be initialized after field 'B_' [-Wreorder]
  , S_( n.S_ )
    ^

and

/Users/tammoippen/Desktop/nest-simulator/nest/sli_neuron.cpp:128:8: warning: unused variable 'terminate' [-Wunused-variable]
  bool terminate = false;
       ^

Apple-clang:

» clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Configuration:

heads/origin/fix-74-osx-clang-problems@e09a686a

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          :
Target System       : Darwin
Cross Compiling     : FALSE
C compiler          : /Library/Developer/CommandLineTools/usr/bin/cc
C compiler flags    :  -O2 -Wall
C++ compiler        : /Library/Developer/CommandLineTools/usr/bin/c++
C++ compiler flags  :  -O2 -Wall
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : No
Use threading       : No
Use GSL             : Yes (GSL 2.3)
    Includes        : /usr/local/Cellar/gsl/2.3/include
    Libraries       : /usr/local/Cellar/gsl/2.3/lib/libgsl.dylib;/usr/local/Cellar/gsl/2.3/lib/libgslcblas.dylib

Use Readline        : Yes (GNU Readline 4.2)
    Includes        : /usr/include
    Libraries       : /usr/lib/libreadline.dylib;/usr/lib/libncurses.dylib

Use libltdl         : Yes (LTDL 2.4.6)
    Includes        : /usr/local/include
    Libraries       : /usr/local/lib/libltdl.dylib

Use doxygen         : Yes (/usr/local/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/local/bin/dot)
                    : target `fulldoc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

--------------------------------------------------------------------------------

Builds and all tests are passing. 👍.

GCC

» gcc-7 --version
gcc-7 (Homebrew GCC 7.1.0) 7.1.0

Configuration:

heads/origin/fix-74-osx-clang-problems@e09a686a

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          :
Target System       : Darwin
Cross Compiling     : FALSE
C compiler          : /usr/local/bin/gcc-7
C compiler flags    :  -O2 -Wall -fopenmp -fdiagnostics-color=auto
C++ compiler        : /usr/local/bin/g++-7
C++ compiler flags  :  -O2 -Wall -fopenmp -fdiagnostics-color=auto
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : No
Use threading       : Yes (OpenMP: -fopenmp)
Use GSL             : Yes (GSL 2.3)
    Includes        : /usr/local/Cellar/gsl/2.3/include
    Libraries       : /usr/local/Cellar/gsl/2.3/lib/libgsl.dylib;/usr/local/Cellar/gsl/2.3/lib/libgslcblas.dylib

Use Readline        : Yes (GNU Readline 4.2)
    Includes        : /usr/include
    Libraries       : /usr/lib/libreadline.dylib;/usr/lib/libncurses.dylib

Use libltdl         : Yes (LTDL 2.4.6)
    Includes        : /usr/local/include
    Libraries       : /usr/local/lib/libltdl.dylib

Use doxygen         : Yes (/usr/local/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/local/bin/dot)
                    : target `fulldoc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

--------------------------------------------------------------------------------

Builds and all tests are passing. 👍

Homebrew Clang

» /usr/local/opt/llvm/bin/clang --version
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

Configuration

heads/origin/fix-74-osx-clang-problems@e09a686a

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          :
Target System       : Darwin
Cross Compiling     : FALSE
C compiler          : /usr/local/opt/llvm/bin/clang
C compiler flags    :  -O2 -Wall -fopenmp=libomp
C++ compiler        : /usr/local/opt/llvm/bin/clang++
C++ compiler flags  :  -O2 -Wall -fopenmp=libomp
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : No
Use threading       : Yes (OpenMP: -fopenmp=libomp)
Use GSL             : Yes (GSL 2.3)
    Includes        : /usr/local/Cellar/gsl/2.3/include
    Libraries       : /usr/local/Cellar/gsl/2.3/lib/libgsl.dylib;/usr/local/Cellar/gsl/2.3/lib/libgslcblas.dylib

Use Readline        : Yes (GNU Readline 4.2)
    Includes        : /usr/include
    Libraries       : /usr/lib/libreadline.dylib;/usr/lib/libncurses.dylib

Use libltdl         : Yes (LTDL 2.4.6)
    Includes        : /usr/local/include
    Libraries       : /usr/local/lib/libltdl.dylib

Use doxygen         : Yes (/usr/local/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/local/bin/dot)
                    : target `fulldoc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

--------------------------------------------------------------------------------

Builds and all tests are passing. 👍

Contributor

tammoippen commented May 24, 2017

Working on macOS 10.12.5 (16F73)

I test some compilers for the default configurations. Seems good so far - all are building and tests are passing.

There are some compiler warnings, though:

/Users/tammoippen/Desktop/nest-simulator/models/noise_generator.cpp:182:5: warning: field 'S_' will be initialized after field 'B_' [-Wreorder]
  , S_()
    ^
/Users/tammoippen/Desktop/nest-simulator/models/noise_generator.cpp:196:5: warning: field 'S_' will be initialized after field 'B_' [-Wreorder]
  , S_( n.S_ )
    ^

and

/Users/tammoippen/Desktop/nest-simulator/nest/sli_neuron.cpp:128:8: warning: unused variable 'terminate' [-Wunused-variable]
  bool terminate = false;
       ^

Apple-clang:

» clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Configuration:

heads/origin/fix-74-osx-clang-problems@e09a686a

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          :
Target System       : Darwin
Cross Compiling     : FALSE
C compiler          : /Library/Developer/CommandLineTools/usr/bin/cc
C compiler flags    :  -O2 -Wall
C++ compiler        : /Library/Developer/CommandLineTools/usr/bin/c++
C++ compiler flags  :  -O2 -Wall
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : No
Use threading       : No
Use GSL             : Yes (GSL 2.3)
    Includes        : /usr/local/Cellar/gsl/2.3/include
    Libraries       : /usr/local/Cellar/gsl/2.3/lib/libgsl.dylib;/usr/local/Cellar/gsl/2.3/lib/libgslcblas.dylib

Use Readline        : Yes (GNU Readline 4.2)
    Includes        : /usr/include
    Libraries       : /usr/lib/libreadline.dylib;/usr/lib/libncurses.dylib

Use libltdl         : Yes (LTDL 2.4.6)
    Includes        : /usr/local/include
    Libraries       : /usr/local/lib/libltdl.dylib

Use doxygen         : Yes (/usr/local/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/local/bin/dot)
                    : target `fulldoc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

--------------------------------------------------------------------------------

Builds and all tests are passing. 👍.

GCC

» gcc-7 --version
gcc-7 (Homebrew GCC 7.1.0) 7.1.0

Configuration:

heads/origin/fix-74-osx-clang-problems@e09a686a

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          :
Target System       : Darwin
Cross Compiling     : FALSE
C compiler          : /usr/local/bin/gcc-7
C compiler flags    :  -O2 -Wall -fopenmp -fdiagnostics-color=auto
C++ compiler        : /usr/local/bin/g++-7
C++ compiler flags  :  -O2 -Wall -fopenmp -fdiagnostics-color=auto
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : No
Use threading       : Yes (OpenMP: -fopenmp)
Use GSL             : Yes (GSL 2.3)
    Includes        : /usr/local/Cellar/gsl/2.3/include
    Libraries       : /usr/local/Cellar/gsl/2.3/lib/libgsl.dylib;/usr/local/Cellar/gsl/2.3/lib/libgslcblas.dylib

Use Readline        : Yes (GNU Readline 4.2)
    Includes        : /usr/include
    Libraries       : /usr/lib/libreadline.dylib;/usr/lib/libncurses.dylib

Use libltdl         : Yes (LTDL 2.4.6)
    Includes        : /usr/local/include
    Libraries       : /usr/local/lib/libltdl.dylib

Use doxygen         : Yes (/usr/local/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/local/bin/dot)
                    : target `fulldoc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

--------------------------------------------------------------------------------

Builds and all tests are passing. 👍

Homebrew Clang

» /usr/local/opt/llvm/bin/clang --version
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

Configuration

heads/origin/fix-74-osx-clang-problems@e09a686a

--------------------------------------------------------------------------------
NEST Configuration Summary
--------------------------------------------------------------------------------

Build type          :
Target System       : Darwin
Cross Compiling     : FALSE
C compiler          : /usr/local/opt/llvm/bin/clang
C compiler flags    :  -O2 -Wall -fopenmp=libomp
C++ compiler        : /usr/local/opt/llvm/bin/clang++
C++ compiler flags  :  -O2 -Wall -fopenmp=libomp
Build dynamic       : ON

Built-in modules    : models;precise;topology
User modules        : None
Python bindings     : No
Use threading       : Yes (OpenMP: -fopenmp=libomp)
Use GSL             : Yes (GSL 2.3)
    Includes        : /usr/local/Cellar/gsl/2.3/include
    Libraries       : /usr/local/Cellar/gsl/2.3/lib/libgsl.dylib;/usr/local/Cellar/gsl/2.3/lib/libgslcblas.dylib

Use Readline        : Yes (GNU Readline 4.2)
    Includes        : /usr/include
    Libraries       : /usr/lib/libreadline.dylib;/usr/lib/libncurses.dylib

Use libltdl         : Yes (LTDL 2.4.6)
    Includes        : /usr/local/include
    Libraries       : /usr/local/lib/libltdl.dylib

Use doxygen         : Yes (/usr/local/bin/doxygen)
                    : target `doc` available
    `dot` available : Yes (/usr/local/bin/dot)
                    : target `fulldoc` available
Use MPI             : No
Use MUSIC           : No
Use libneurosim     : No

--------------------------------------------------------------------------------

Builds and all tests are passing. 👍

@tammoippen

Nicely done! 👍

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser May 24, 2017

Contributor

@tammoippen The compiler warnings are addressed by #729 --- feel free to approve :)!

Contributor

heplesser commented May 24, 2017

@tammoippen The compiler warnings are addressed by #729 --- feel free to approve :)!

@heplesser heplesser merged commit 7638572 into nest:master May 24, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@heplesser heplesser deleted the heplesser:fix-74-osx-clang-problems branch May 26, 2017

@tammoippen tammoippen referenced this pull request Dec 12, 2017

Closed

nest: migrate to homebrew/core #21561

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment