Opened 8 years ago

Closed 8 years ago

Last modified 2 years ago

#52554 closed defect (wontfix)

libomp @3.9.0_1 won't build on Snow Leopard, Mac OS X 10.6.8, because of missing llvm-lit?

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: eborisch (Eric A. Borisch), udbraumann, maxkalashnikov@…, devernay (Frédéric Devernay)
Port: libomp

Description

I tried to build with

  llvm-3.6 @3.6.2_4 (active)
  llvm-3.7 @3.7.1_4+assertions (active)
  llvm-3.8 @3.8.1_0+assertions+debug (active)

and always saw

-- LIBOMP: Operating System     -- Darwin
-- LIBOMP: Target Architecture  -- x86_64
-- LIBOMP: Build Type           -- Release
-- LIBOMP: OpenMP Version       -- 45
-- LIBOMP: Library Kind         -- SHARED
-- LIBOMP: Library Type         -- normal
-- LIBOMP: Fortran Modules      -- FALSE
-- LIBOMP: Build                -- 20140926
-- LIBOMP: Use Stats-gathering  -- FALSE
-- LIBOMP: Use Debugger-support -- FALSE
-- LIBOMP: Use ITT notify       -- TRUE
-- LIBOMP: Use OMPT-support     -- FALSE
-- LIBOMP: Use Adaptive locks   -- TRUE
-- LIBOMP: Use quad precision   -- FALSE
-- LIBOMP: Use Hwloc library    -- FALSE
-- Found PythonInterp: /opt/local/bin/python (found version "2.7.12") 
-- Looking for sqrt in m
-- Looking for sqrt in m - found
-- LIBOMP: Cannot find llvm-lit.
-- LIBOMP: Please put llvm-lit in your PATH, set LIBOMP_LLVM_LIT_EXECUTABLE to its full path or point OPENMP_LLVM_TOOLS_DIR to its directory
CMake Warning at cmake/LibompUtils.cmake:21 (message):
  LIBOMP: The check-libomp target will not be available!
Call Stack (most recent call first):
  test/CMakeLists.txt:52 (libomp_warning_say)

and finally received

[ 28%] Building C object src/CMakeFiles/omp.dir/kmp_debug.c.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64/src && /opt/local/bin/clang-mp-3.6  -Domp_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/i18n -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/include/45 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/thirdparty/ittnotify  -pipe -Os  -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6 -fPIC   -D _GNU_SOURCE -D _REENTRANT -I/opt/local/include -std=c++11 -fno-exceptions -Wno-sign-compare -Wno-unused-function -Wno-unused-local-typedef -Wno-unused-value -Wno-unused-variable -Wno-switch -Wno-covered-switch-default -Wno-deprecated-register -Wno-gnu-anonymous-struct -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-missing-braces -Wno-comment -Wno-self-assign -Wno-vla-extension -x c++ -o CMakeFiles/omp.dir/kmp_itt.c.o   -c /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_itt.c
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64/src && /opt/local/bin/clang-mp-3.6  -Domp_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/i18n -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/include/45 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/thirdparty/ittnotify  -pipe -Os  -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6 -fPIC   -D _GNU_SOURCE -D _REENTRANT -I/opt/local/include -std=c++11 -fno-exceptions -Wno-sign-compare -Wno-unused-function -Wno-unused-local-typedef -Wno-unused-value -Wno-unused-variable -Wno-switch -Wno-covered-switch-default -Wno-deprecated-register -Wno-gnu-anonymous-struct -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-missing-braces -Wno-comment -Wno-self-assign -Wno-vla-extension -x c++ -o CMakeFiles/omp.dir/kmp_debug.c.o   -c /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_debug.c
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_atomic.c:16:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_atomic.h:20:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_itt.c:19:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_itt.h:20:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_environment.c:60:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp.h:92:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_debug.c:16:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp.h:92:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_error.c:16:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp.h:92:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_alloc.c:16:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp.h:92:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_csupport.c:17:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp.h:92:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_global.c:16:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp.h:92:
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_environment.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_debug.c.o] Error 1
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_global.c.o] Error 1
make[2]: *** [src/CMakeFiles/omp.dir/kmp_error.c.o] Error 1
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_alloc.c.o] Error 1
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_itt.c.o] Error 1
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_csupport.c.o] Error 1
1 error generated.
make[2]: *** [src/CMakeFiles/omp.dir/kmp_atomic.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64'
make[1]: *** [src/CMakeFiles/omp.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64" && /usr/bin/make -j8 -w all VERBOSE=ON 
Exit code: 2
Error: org.macports.build for port libomp returned: command execution failed

And indeed I don't have an atomic.h file in my system…

Attachments (2)

main.log (61.0 KB) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
libomp.patch (1.1 KB) - added by devernay (Frédéric Devernay) 7 years ago.
libomp Portfile patch

Download all attachments as: .zip

Change History (21)

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

comment:1 Changed 8 years ago by udbraumann

Cc: braumann@… added

Cc Me!

comment:2 Changed 8 years ago by maxkalashnikov@…

Cc: maxkalashnikov@… added

Cc Me!

comment:3 Changed 8 years ago by maxkalashnikov@…

Same problem under Mountain Lion (10.8).

Setting

cxx_stdlib      libc++
delete_la_files yes
buildfromsource always

has no effect, nor does using clang-3.6 and llvm-3.6 built from source.

comment:4 Changed 8 years ago by eborisch (Eric A. Borisch)

I don't have a test bed; did the 380 (previous) version build OK?

comment:5 Changed 8 years ago by maxkalashnikov@…

Previous version built OK for me on ML.

comment:6 in reply to:  4 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Replying to eborisch@…:

I don't have a test bed; did the 380 (previous) version build OK?

I have on Snow Leopard: libomp @3.8.1_0+universal (active).

comment:7 Changed 8 years ago by eborisch (Eric A. Borisch)

Resolution: wontfix
Status: newclosed

I've rolled back to 3.8.1 for <= ML. I think I have a device I can test on at some point, but this isn't high priority for me.

If someone else wants to chase down what is breaking on these old OSes, by all means...

(Oh, and for the ticket archeologists, it is not failing due to missing llvm-lit.)

comment:8 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Could it be that it is failing due to a typo?

root 325 /\ find /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work -type f -name "*.[ch]" -exec grep atomic {} /dev/null \; | grep include
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/final/runtime/src/kmp_atomic.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/final/runtime/src/kmp_gsupport.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/final/runtime/src/kmp_lock.h:#include <atomic>
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/final/runtime/src/kmp_runtime.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/final/runtime/src/kmp_settings.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_atomic.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_gsupport.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:#include <atomic>
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_runtime.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_settings.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-i386/src/kmp_atomic.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-i386/src/kmp_gsupport.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-i386/src/kmp_lock.h:#include <atomic>
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-i386/src/kmp_runtime.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-i386/src/kmp_settings.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-x86_64/src/kmp_atomic.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-x86_64/src/kmp_gsupport.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-x86_64/src/kmp_lock.h:#include <atomic>
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-x86_64/src/kmp_runtime.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-x86_64/src/kmp_settings.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc2/runtime/src/kmp_atomic.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc2/runtime/src/kmp_gsupport.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc2/runtime/src/kmp_lock.h:#include <atomic>
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc2/runtime/src/kmp_runtime.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc2/runtime/src/kmp_settings.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc3/runtime/src/kmp_atomic.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc3/runtime/src/kmp_gsupport.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc3/runtime/src/kmp_lock.h:#include <atomic>
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc3/runtime/src/kmp_runtime.c:#include "kmp_atomic.h"
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc3/runtime/src/kmp_settings.c:#include "kmp_atomic.h"
root 326 /\ find /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work -type f -name "*atomic.h" -ls
58171091      120 -rw-r--r--    1 macports admin       61377  1 Sep 01:31 /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/final/runtime/src/kmp_atomic.h
58171600      120 -rw-r--r--    1 macports admin       61377  1 Sep 01:31 /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_atomic.h
58174266      120 -rw-r--r--    1 macports admin       61377  1 Sep 01:31 /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-i386/src/kmp_atomic.h
58173056      120 -rw-r--r--    1 macports admin       61377  1 Sep 01:31 /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime-x86_64/src/kmp_atomic.h
58172108      120 -rw-r--r--    1 macports admin       61377  1 Sep 01:31 /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc2/runtime/src/kmp_atomic.h
58172616      120 -rw-r--r--    1 macports admin       61377  1 Sep 01:31 /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc3/runtime/src/kmp_atomic.h

There aren't so many files that include a *atomic.h header file. Those that do so are named "kmp_*.c, except one: kmp_lock.h. It includes an <atomic> C header file from some standard path for C header files.

This atomic.h file can be something new – Snow Leopard (Mac OS X 10.6.8), PPC Leopard (Mac OS X 10.5.8), and PPC Tiger (Mac OS X 10.4.11) do not have such a file.

#include <atomic> can be a typo, standing for #include "kmp_atomic.h"… What is in the previous version containing?

If it's not an error than it might be worth to try a guard allowing inclusion only on Mountain Lion and later…

comment:9 Changed 8 years ago by maxkalashnikov@…

My understanding is that this is a valid include when using the c++11 standard but not older ones. If you search for the cxx_stdlib MacPorts setting on the web, I think you'll find plenty of references describing it.

My suspicion is that, if there's a typo, it has to do with configure/build options for the package. If I have time this week or, more likely, this upcoming weekend, I'll try chasing it down.

comment:10 in reply to:  9 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Replying to maxkalashnikov@…:

My understanding is that this is a valid include when using the c++11 standard but not older ones. If you search for the cxx_stdlib MacPorts setting on the web, I think you'll find plenty of references describing it.

I am lacking understanding of C++, but your explication does explain why this error occurs when #include <atomic> is not used:

/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_lang_libomp/libomp/work/openmp-390/rc1/runtime/src/kmp_lock.h:260:5: error: use of undeclared identifier 'std'
    std::atomic<bool>     initialized;
    ^

These are the lines in mp_lock.h:

 243 #ifdef _MSC_VER
 244 // MSVC won't allow use of std::atomic<> in a union since it has non-trivial copy constructor.
 245 
 246 struct kmp_base_ticket_lock {
 247     // `initialized' must be the first entry in the lock data structure!
 248     std::atomic_bool      initialized;
 249     volatile union kmp_ticket_lock *self; // points to the lock union
 250     ident_t const *       location;       // Source code location of omp_init_lock().
 251     std::atomic_uint      next_ticket;    // ticket number to give to next thread which acquires
 252     std::atomic_uint      now_serving;    // ticket number for thread which holds the lock
 253     std::atomic_int       owner_id;       // (gtid+1) of owning thread, 0 if unlocked
 254     std::atomic_int       depth_locked;   // depth locked, for nested locks only
 255     kmp_lock_flags_t      flags;          // lock specifics, e.g. critical section lock
 256 };
 257 #else
 258 struct kmp_base_ticket_lock {
 259     // `initialized' must be the first entry in the lock data structure!
 260     std::atomic<bool>     initialized;
 261     volatile union kmp_ticket_lock *self; // points to the lock union
 262     ident_t const *       location;       // Source code location of omp_init_lock().
 263     std::atomic<unsigned> next_ticket;    // ticket number to give to next thread which acquires
 264     std::atomic<unsigned> now_serving;    // ticket number for thread which holds the lock
 265     std::atomic<int>      owner_id;       // (gtid+1) of owning thread, 0 if unlocked
 266     std::atomic<int>      depth_locked;   // depth locked, for nested locks only
 267     kmp_lock_flags_t      flags;          // lock specifics, e.g. critical section lock
 268 };
 269 #endif

Wouldn't GCC5, GCC49, GCC48, and GCC47 with -std=c++11 -std=c11 work?

comment:11 Changed 8 years ago by eborisch (Eric A. Borisch)

Looking at this a little more, I think this is a libstdc++ vs. libc++ issue. If you run the compiler with -stdlib=libc++, it includes the v1/ include directories (where atomic lives) ...

comment:12 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

I don't know what happened, and when it happened, but I have now installed:

  libomp @3.8.1_2+universal (active)

comment:13 Changed 8 years ago by eborisch (Eric A. Borisch)

It's 3.9 that won't build against the old c++ headers; I moved os.major <= 12 back to 3.8.1.

comment:14 Changed 7 years ago by devernay (Frédéric Devernay)

libomp 3.8.1 has severe bugs, so I wanted libomp 3.9.1 on SL

The real limit is not the macOS version, but the fact that the system supports libc++: this should be checked instead of the system version.

However, kmp_alloc.c includes indirectly <atomic>, but it's a C file... and the CMAKE_C_FLAGS don't have -stdlib=libc++:

:info:build cd /opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64/src && /opt/local/bin/clang-mp-3.9  -Domp_EXPORTS -I/opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/build-x86_64/src -I/opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src -I/opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/i18n -I/opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/include/45 -I/opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/thirdparty/ittnotify  -pipe -O2 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.6 -fPIC   -D _GNU_SOURCE -D _REENTRANT -I/opt/local/include -std=c++11 -fno-exceptions -Wno-sign-compare -Wno-unused-function -Wno-unused-local-typedef -Wno-unused-value -Wno-unused-variable -Wno-switch -Wno-covered-switch-default -Wno-deprecated-register -Wno-gnu-anonymous-struct -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-missing-braces -Wno-comment -Wno-self-assign -Wno-vla-extension -Wno-format-pedantic -x c++ -o CMakeFiles/omp.dir/kmp_alloc.c.o   -c /opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/kmp_alloc.c
:info:build In file included from /opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/kmp_itt.c:19:
:info:build In file included from /opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/kmp_itt.h:20:
:info:build /opt/local-libc++/var/macports/build/_opt_local-libc++_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_libomp/libomp/work/openmp-391/rc1/runtime/src/kmp_lock.h:26:10: fatal error: 'atomic' file not found
:info:build #include <atomic>
...

An easy fix is to append -stdlib=libc++ to the configure.cflags. This can be done in the libomp Portfile, but shouldn't it be done globally on systems where libc++ is not the default?

Anyway, I'm attaching a fix to get the latest libomp on older systems with libc++

Changed 7 years ago by devernay (Frédéric Devernay)

Attachment: libomp.patch added

libomp Portfile patch

comment:15 Changed 7 years ago by devernay (Frédéric Devernay)

Cc: devernay added

comment:16 Changed 7 years ago by eborisch (Eric A. Borisch)

The second comparison (change to line 48) in libomp.patch should be ${configure.cxx_stdlib} ne "libstdc++" to my eye...

I'm not missing something, am I?

comment:17 Changed 7 years ago by kencu (Ken)

Wait a sec -- what this block does is : if the user is set to libstdc++, force the -stdlib=libc++ flag onto the build line to make it build.

if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} eq "libstdc++"} {
	        if {${os.major} <= 12} {
	            # kmp_alloc.c includes <atomic> but libc++ is not the default on these systems
	            # see https://trac.macports.org/ticket/52554
	            configure.cflags-appends -stdlib=libc++
	        }
}

It might build. But I would argue that now we don't know where the heck we are. What is linked to what? You're mixing standard libraries, and only grief can follow that.

A proper fix would appear to be to first make sure the user is set up to use libc++, and if so, add the flag if it is still needed (on some builds it is) -- not to force the flag when it is not appropriate, just to make it build.

comment:18 in reply to:  17 Changed 2 years ago by barracuda156

Replying to kencu:

Wait a sec -- what this block does is : if the user is set to libstdc++, force the -stdlib=libc++ flag onto the build line to make it build.

if {${os.platform} eq "darwin" && ${configure.cxx_stdlib} eq "libstdc++"} {
	        if {${os.major} <= 12} {
	            # kmp_alloc.c includes <atomic> but libc++ is not the default on these systems
	            # see https://trac.macports.org/ticket/52554
	            configure.cflags-appends -stdlib=libc++
	        }
}

It might build. But I would argue that now we don't know where the heck we are. What is linked to what? You're mixing standard libraries, and only grief can follow that.

A proper fix would appear to be to first make sure the user is set up to use libc++, and if so, add the flag if it is still needed (on some builds it is) -- not to force the flag when it is not appropriate, just to make it build.

Can’t it be fixed by writing something of this kind? https://github.com/classilla/tenfourfox/blob/master/js/src/jit/osxppc/AtomicOperations-ppc.h (obviously, not restricting to ppc).

Last edited 2 years ago by barracuda156 (previous) (diff)

comment:19 Changed 2 years ago by kencu (Ken)

this was fixed years ago, and it is not broken now.

#include <atomic>

requires a c++11 capable compiler that is put into c++11 mode and building against a c++11-capable standard library.

For most of macports that is clang++ -std=c++11 -stdlib=libc++.

For gcc7, you should not have to do anything much as it defaults to c++11 and also a c++11-capable stdlib. You would only have to make sure you don't screw up the defaults somehow by being too clever about things.

Note: See TracTickets for help on using tickets.