[MacPorts] #62488: py38-scipy - vodemodule.c - fatal error: 'threads.h' not found

MacPorts noreply at macports.org
Sun Apr 11 04:09:32 UTC 2021


#62488: py38-scipy -  vodemodule.c - fatal error: 'threads.h' not found
-------------------------+-----------------------
  Reporter:  dyne2meter  |      Owner:  michaelld
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.4
Resolution:              |   Keywords:  elcapitan
      Port:  py-scipy    |
-------------------------+-----------------------

Comment (by astroboylrx):

 Replying to [comment:8 michaelld]:
 > Interesting & thanks for that fix for older OSX. I still have this issue
 as noted on 11.3 latest beta. It errors out on trying to include
 <thread.h> exactly as noted. Admittedly I'm using gcc-devel ... let me try
 with one of the other variants ... this might be a GCC issue!

 Have you found a work around now? I also ran into this issue and I'm using
 the +gcc9 variant. The log shows

 {{{
 :info:build error: Command "/opt/local/bin/gcc-mp-9 -Wno-unused-result
 -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv
 -O3 -Wall -pipe -Os
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DHAVE_CBLAS
 -Ibuild/src.macosx-11.2-x86_64-3.7/build/src.macosx-11.2-x86_64-3.7/scipy/integrate
 -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/core/include
 -Ibuild/src.macosx-11.2-x86_64-3.7/numpy/distutils/include
 -I/opt/local/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m
 -c build/src.macosx-11.2-x86_64-3.7/scipy/integrate/vodemodule.c -o
 build/temp.macosx-11.2-x86_64-3.7/build/src.macosx-11.2-x86_64-3.7/scipy/integrate/vodemodule.o
 -MMD -MF
 build/temp.macosx-11.2-x86_64-3.7/build/src.macosx-11.2-x86_64-3.7/scipy/integrate/vodemodule.o.d
 -msse -msse2 -msse3" failed with exit status 1
 }}}

 So I manually ran this compile command and found the error is due to

 {{{
 build/src.macosx-11.2-x86_64-3.7/scipy/integrate/vodemodule.c:86:10: fatal
 error: threads.h: No such file or directory
 }}}

 Okay, that's more clear and makes sense. I went to this `vodemodule.c` and
 found you can actually define `__STDC_NO_THREADS__` to inform it that
 `threads.h` is not supported by the compiler. I tried the previous compile
 command with `-D__STDC_NO_THREADS__` and the command finished without
 error. I thought I might be able to add this into the environment variable
 `CFLAGS` as a work around, so I did `export
 CFLAGS="-D__STDC_NO_THREADS__"`. However, no luck.

 I further found, in the build log of MacPorts, that the installation used
 `--no-user-cfg` while running `setup.py build`


 {{{
 :info:build Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports
 .org_macports_release_tarballs_ports_python_py-
 scipy/py37-scipy/work/scipy-1.6.2" &&
 /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
 setup.py --no-user-cfg build -j8
 }}}

 So I again manually ran the build command without that: `sudo
 /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
 setup.py build -j8`, which again finished successfully.

 The next step should just be something like `python setup.py install`.
 However, I don't know how `port` handles this process. Rerun `port
 upgrade` or `port install` didn't work b/c `port` did everything from a
 fresh restart.

 Any suggestions would be greatly appreciated!

-- 
Ticket URL: <https://trac.macports.org/ticket/62488#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list