Would be nice if a package is provided for conda-forge. I created a staged-recipe here: https://github.com/conda-forge/staged-recipes/pull/8277 but this still needs a lot of work.
I never used ifcopenshell, but freecad-users needs it. Maybe someone can help with making the build pass.
ci's are stuck with:
linux, osx: no idea cmake 166: unable to find header files
windows: occ not found
Thanks this is great. Did you see the conda recipe in the 0.6.0 branch? https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.6.0/conda We chose to publish 0.6 https://anaconda.org/ifcopenshell/ifcopenshell because it allows multiple schemas at runtime. But I think freecad is still on master/0.5.
Where does the occt dependency come from?
Did you see the conda recipe in the 0.6.0 branch?
yes I used it as the base for this recipe
We chose to publish 0.6 https://anaconda.org/ifcopenshell/ifcopenshell because it allows multiple schemas at runtime. But I think freecad is still on master/0.5.
There is no 0.6.0 on the release page (github). Where can I find the source?
Where does the occt dependency come from?
I would like to use the same occ-library for ifcopenshell and freecad. Therefor I would like to use occt.
edit: some other questions:
Therefor I would like to use occt.
Sounds good to me. Especially if it's a recent version. I looked it up on conda-forge and it seems the include files are in a folder opencasade/ but the cmake command you provide searches for occt/ https://github.com/conda-forge/staged-recipes/pull/8277/files#diff-cf0a4024c796226f0664f8b7552cc02bR10
Which compiler should I use for windows?
Preferably the compiler that Python was built with, but this is always an issue on Windows. Not sure how conda-forge manages that. But I think it's MSVC 2015 for the recent versions of Python3.
I see cases where windows use static libs, would it be possible to make this more consistent with other platforms to link dynamically.
Yes, this is slowly getting fixed in the 0.6 branch.
@looooo are you planning to continue working on this? It aligns a bit with my aims to create new tags in the master (0.5.0-rc1) and 0.6 (0.6-beta1) branches soon. So if we coordinate this a bit we might be able to push something recent and stable to conda-forge. Let me know what I can do to help.
Sorry for the late response. There were several issues:
Conda doesn't allwo a "-" in the version string. Maybe 0.6.0.beta1 would be possible?
I am not yet sure what the other issues are about. It would be nice if you can help with getting them resolved.
Thanks. I will name it 0.6.0b0 in accordance with the tags that already exist e.g. https://github.com/IfcOpenShell/IfcOpenShell/releases/tag/v0.6.0a1
It would be nice if you can help with getting them resolved.
Sure thing. Seems I had not been at much help earlier, there is a typo in what I wrote: opencasade/ would need to be opencascade/ with a 2nd c :(
I looked it up on conda-forge and it seems the include files are in a folder opencasade/ but the cmake command ...
For now I would build the recipe from git if possible and just use the v0.6.0 branch as the rev [1] until everything is properly tagged (i.e. soon, otherwise use the v0.6.0a1 tag, or master branch if that is required by freecad)
[1] https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#source-from-git
Thanks for your input. I updated the recipe to use latest master.
One question: Was this library ever tested with occt7.3.0?
edit: occt seems not to be a problem
copying the current build-errors. Maybe you can help with this again.
linux/osx:
[33/38] Swig compile IfcPython.i for python
FAILED: ifcwrap/CMakeFiles/_ifcopenshell_wrapper.dir/IfcPythonPYTHON_wrap.cxx ifcwrap/ifcopenshell_wrapper.py
cd $SRC_DIR/build/ifcwrap && $BUILD_PREFIX/bin/cmake -E make_directory $SRC_DIR/build/ifcwrap $SRC_DIR/build/ifcwrap/CMakeFiles/_ifcopenshell_wrapper.dir && $BUILD_PREFIX/bin/cmake -E env SWIG_LIB=$BUILD_PREFIX/share/swig/4.0.0 $BUILD_PREFIX/bin/swig -python -outdir $SRC_DIR/build/ifcwrap -c++ -I$PREFIX/include/opencascade -I$PREFIX/include -I$PREFIX/include/python3.6m -I$SRC_DIR/src/ifcwrap -o $SRC_DIR/build/ifcwrap/CMakeFiles/_ifcopenshell_wrapper.dir/IfcPythonPYTHON_wrap.cxx $SRC_DIR/src/ifcwrap/IfcPython.i
$SRC_DIR/src/ifcwrap/IfcGeomWrapper.i:60: Error: Static function vector_to_list(std::vector< IfcSchema::IfcProduct * > const &) const cannot have a qualifier.
windows
[34/38] Linking CXX executable IfcConvert.exe
FAILED: IfcConvert.exe
cmd.exe /C "cd . && %BUILD_PREFIX%\Library\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\IfcConvert.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\x64\mt.exe --manifests -- C:\PROGRA~2\MI0E91~1.0\VC\bin\amd64\link.exe /nologo CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\ColladaSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\IfcConvert.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\OpenCascadeBasedSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\SvgSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\WavefrontObjSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\XmlSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\util.cpp.obj /out:IfcConvert.exe /implib:IfcConvert.lib /pdb:IfcConvert.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console IfcParse.lib IfcGeom.lib %PREFIX%\Library\lib\TKernel.lib %PREFIX%\Library\lib\TKMath.lib %PREFIX%\Library\lib\TKBRep.lib %PREFIX%\Library\lib\TKGeomBase.lib %PREFIX%\Library\lib\TKGeomAlgo.lib %PREFIX%\Library\lib\TKG3d.lib %PREFIX%\Library\lib\TKG2d.lib %PREFIX%\Library\lib\TKShHealing.lib %PREFIX%\Library\lib\TKTopAlgo.lib %PREFIX%\Library\lib\TKMesh.lib %PREFIX%\Library\lib\TKPrim.lib %PREFIX%\Library\lib\TKBool.lib %PREFIX%\Library\lib\TKBO.lib %PREFIX%\Library\lib\TKFillet.lib %PREFIX%\Library\lib\TKSTEP.lib %PREFIX%\Library\lib\TKSTEPBase.lib %PREFIX%\Library\lib\TKSTEPAttr.lib %PREFIX%\Library\lib\TKXSBase.lib %PREFIX%\Library\lib\TKSTEP209.lib %PREFIX%\Library\lib\TKIGES.lib %PREFIX%\Library\lib\TKOffset.lib ws2_32.lib %PREFIX%\Library\lib\libboost_system.lib %PREFIX%\Library\lib\libboost_program_options.lib %PREFIX%\Library\lib\libboost_regex.lib %PREFIX%\Library\lib\libboost_thread.lib %PREFIX%\Library\lib\libboost_date_time.lib %PREFIX%\Library\lib\libboost_chrono.lib %PREFIX%\Library\lib\libboost_atomic.lib %PREFIX%\Library\lib\icuuc.lib %PREFIX%\Library\lib\icudt.lib IfcParse.lib %PREFIX%\Library\lib\libboost_system.lib %PREFIX%\Library\lib\libboost_program_options.lib %PREFIX%\Library\lib\libboost_regex.lib %PREFIX%\Library\lib\libboost_thread.lib %PREFIX%\Library\lib\libboost_date_time.lib %PREFIX%\Library\lib\libboost_chrono.lib %PREFIX%\Library\lib\libboost_atomic.lib %PREFIX%\Library\lib\icuuc.lib %PREFIX%\Library\lib\icudt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK: command "C:\PROGRA~2\MI0E91~1.0\VC\bin\amd64\link.exe /nologo CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\ColladaSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\IfcConvert.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\OpenCascadeBasedSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\SvgSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\WavefrontObjSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\XmlSerializer.cpp.obj CMakeFiles\IfcConvert.dir\C_\bld\ifcopenshell_1558701538964\work\src\ifcconvert\util.cpp.obj /out:IfcConvert.exe /implib:IfcConvert.lib /pdb:IfcConvert.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console IfcParse.lib IfcGeom.lib %PREFIX%\Library\lib\TKernel.lib %PREFIX%\Library\lib\TKMath.lib %PREFIX%\Library\lib\TKBRep.lib %PREFIX%\Library\lib\TKGeomBase.lib %PREFIX%\Library\lib\TKGeomAlgo.lib %PREFIX%\Library\lib\TKG3d.lib %PREFIX%\Library\lib\TKG2d.lib %PREFIX%\Library\lib\TKShHealing.lib %PREFIX%\Library\lib\TKTopAlgo.lib %PREFIX%\Library\lib\TKMesh.lib %PREFIX%\Library\lib\TKPrim.lib %PREFIX%\Library\lib\TKBool.lib %PREFIX%\Library\lib\TKBO.lib %PREFIX%\Library\lib\TKFillet.lib %PREFIX%\Library\lib\TKSTEP.lib %PREFIX%\Library\lib\TKSTEPBase.lib %PREFIX%\Library\lib\TKSTEPAttr.lib %PREFIX%\Library\lib\TKXSBase.lib %PREFIX%\Library\lib\TKSTEP209.lib %PREFIX%\Library\lib\TKIGES.lib %PREFIX%\Library\lib\TKOffset.lib ws2_32.lib %PREFIX%\Library\lib\libboost_system.lib %PREFIX%\Library\lib\libboost_program_options.lib %PREFIX%\Library\lib\libboost_regex.lib %PREFIX%\Library\lib\libboost_thread.lib %PREFIX%\Library\lib\libboost_date_time.lib %PREFIX%\Library\lib\libboost_chrono.lib %PREFIX%\Library\lib\libboost_atomic.lib %PREFIX%\Library\lib\icuuc.lib %PREFIX%\Library\lib\icudt.lib IfcParse.lib %PREFIX%\Library\lib\libboost_system.lib %PREFIX%\Library\lib\libboost_program_options.lib %PREFIX%\Library\lib\libboost_regex.lib %PREFIX%\Library\lib\libboost_thread.lib %PREFIX%\Library\lib\libboost_date_time.lib %PREFIX%\Library\lib\libboost_chrono.lib %PREFIX%\Library\lib\libboost_atomic.lib %PREFIX%\Library\lib\icuuc.lib %PREFIX%\Library\lib\icudt.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:IfcConvert.exe.manifest" failed (exit code 1120) with the following output:
ColladaSerializer.cpp.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
libboost_program_options.lib(value_semantic.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(positional_options.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(variables_map.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(options_description.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(parsers.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(cmdline.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(convert.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(config_file.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_program_options.lib(utf8_codecvt_facet.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_regex.lib(instances.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_regex.lib(regex.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_regex.lib(regex_traits_defaults.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_regex.lib(static_mutex.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_regex.lib(w32_regex_traits.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
libboost_regex.lib(regex_raw_buffer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in IfcConvert.cpp.obj
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
libboost_regex.lib(regex_traits_defaults.obj) : error LNK2001: unresolved external symbol __imp_towupper
IfcConvert.exe : fatal error LNK1120: 1 unresolved externals
windows
The Windows thing should be automatically addressed if you update to v0.6.0 instead (my preference) https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/cmake/CMakeLists.txt#L137 Otherwise we need to add something similar in that branch. Let me know.
$SRC_DIR/src/ifcwrap/IfcGeomWrapper.i:60: Error: Static function vector_to_list(std::vector< IfcSchema::IfcProduct * > const &) const cannot have a qualifier.
That seems to be a perfectly reasonable error message, but I have never seen it before. Apparently conda-forge has a more recent/strict version of SWIG? I fixed it in both master and v0.6.0
https://github.com/IfcOpenShell/IfcOpenShell/commit/9a85fbc2250e7626aac49bdd525614f4e7e405d7
thanks again. Latest swig on conda-forge is 4.0. Maybe this is the reason for the error-report?
There are also some warnings:
CMake Deprecation Warning at /home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/_build_env/share/cmake-3.14/Modules/UseSWIG.cmake:559 (message):
SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
Call Stack (most recent call first):
/home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/work/src/ifcwrap/CMakeLists.txt:56 (SWIG_ADD_MODULE)
CMake Warning (dev) at /home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/_build_env/share/cmake-3.14/Modules/UseSWIG.cmake:600 (message):
Policy CMP0078 is not set: UseSWIG generates standard target names. Run
"cmake --help-policy CMP0078" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
/home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/_build_env/share/cmake-3.14/Modules/UseSWIG.cmake:560 (swig_add_library)
/home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/work/src/ifcwrap/CMakeLists.txt:56 (SWIG_ADD_MODULE)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/_build_env/share/cmake-3.14/Modules/UseSWIG.cmake:460 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/_build_env/share/cmake-3.14/Modules/UseSWIG.cmake:695 (SWIG_ADD_SOURCE_TO_MODULE)
/home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/_build_env/share/cmake-3.14/Modules/UseSWIG.cmake:560 (swig_add_library)
/home/conda/feedstock_root/build_artifacts/ifcopenshell_1558707815482/work/src/ifcwrap/CMakeLists.txt:56 (SWIG_ADD_MODULE)
This warning is for project developers. Use -Wno-dev to suppress it.
Ah and a missing dependency?
FAILED: CMakeFiles/IfcParse.dir$SRC_DIR/src/ifcparse/parse_ifcxml.cpp.o
$BUILD_PREFIX/bin/x86_64-conda_cos6-linux-gnu-c++ -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE -DWITH_IFCXML -I$PREFIX/include/opencascade -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -I$PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/ifcopenshell-v0.6.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -O3 -DNDEBUG -Wall -Wextra -Wno-maybe-uninitialized -fPIC -DIFC_PARSE_EXPORTS -std=gnu++11 -MD -MT CMakeFiles/IfcParse.dir$SRC_DIR/src/ifcparse/parse_ifcxml.cpp.o -MF CMakeFiles/IfcParse.dir$SRC_DIR/src/ifcparse/parse_ifcxml.cpp.o.d -o CMakeFiles/IfcParse.dir$SRC_DIR/src/ifcparse/parse_ifcxml.cpp.o -c $SRC_DIR/src/ifcparse/parse_ifcxml.cpp
$SRC_DIR/src/ifcparse/parse_ifcxml.cpp:7:10: fatal error: libxml/parser.h: No such file or directory
#include <libxml/parser.h>
Yes the warnings I get locally as well.
Ah and a missing dependency?
That is not handled very gracefully at the moment. Can you add https://anaconda.org/conda-forge/libxml2 as a dependency?
Still missing libxml-header after adding libxml2 as host- and run- dependency
windows seems to work better but fails now with:
LINK : fatal error LNK1181: cannot open input file 'Serializers_ifc2x3.lib'
Yes, that's odd. For linux, the header files are in include/libxml2/libxml but for Windows they are in Library/include/libxml This means that only on build.sh we need to add a -D LIBXML2_INCLUDE_DIR:FILEPATH=$PREFIX/include/libxml2 \
If we get linker errors later we'll also need to add -D LIBXML2_LIBRARIES:FILEPATH=$PREFIX/lib/libxml2.a \ For Windows maybe a -D LIBXML2_LIBRARIES:FILEPATH=$PREFIX/lib/libxml2_a.lib \
LINK : fatal error LNK1181: cannot open input file 'Serializers_ifc2x3.lib'
I'm a bit puzzled by that. It seems the Serializers project is not being built at all. That's just the CMake configuration then going wrong which has been working for all other builds. I'll have to run the conda build locally then I think to see what's going on.
thanks again. We also need to test the library. Are there any tests for ifcopenshell? Alternative some python imports will also work as test.
at least the error is now consistent for all platforms:
cannot open input file 'Serializers_ifc2x3.lib' or similar.
cannot open input file 'Serializers_ifc2x3.lib' or similar.
Ok, that was actually on error on my side, can you try again with commit sha 8b382df7ccee4822df52aa89391b208e743f2610 Thanks.
Are there any tests for ifcopenshell? Alternative some python imports will also work as test.
There is a bit of an ad hoc file with assertions that is ran on Travis https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/test/tests.py Note that it requires a git clone --recursive or otherwise with initialized submodules, not sure how that is handled by conda-build. Otherwise just import ifcopenshell I guess.
thanks, I rerun and it seems like compilation works now. There is one problem on osx:
export PREFIX=/usr/local/miniconda/conda-bld/ifcopenshell_1559040066009/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place
export SRC_DIR=/usr/local/miniconda/conda-bld/ifcopenshell_1559040066009/test_tmp
import: 'ifcopenshell'
/usr/local/miniconda/conda-bld/ifcopenshell_1559040066009/test_tmp/conda_test_runner.sh: line 2: 9168 Segmentation fault: 11 "/usr/local/miniconda/conda-bld/ifcopenshell_1559040066009/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/python" -s "/usr/local/miniconda/conda-bld/ifcopenshell_1559040066009/test_tmp/run_test.py"
Tests failed for ifcopenshell-v0.6.0-py36h8cb8744_0.tar.bz2 - moving package to /usr/local/miniconda/conda-bld/broken
WARNING:conda_build.build:Tests failed for ifcopenshell-v0.6.0-py36h8cb8744_0.tar.bz2 - moving package to /usr/local/miniconda/conda-bld/broken
Extension modules should not link against the python library and -undefined dynamic_lookup should be used [1]. We added this recently to freecad [2].
Linux reports a python problem:
import: 'ifcopenshell'
Traceback (most recent call last):
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559040039067/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 47, in <module>
from . import ifcopenshell_wrapper
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559040039067/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 188, in <module>
class Material(object):
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559040039067/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 242, in Material
if _newclass:
NameError: name '_newclass' is not defined
----------------------------------------------------------------
windows reports an import issue:
Traceback (most recent call last):
File "C:\Miniconda\conda-bld\ifcopenshell_1559040198341\_test_env\lib\site-packages\ifcopenshell\__init__.py", line 47, in <module>
from . import ifcopenshell_wrapper
File "C:\Miniconda\conda-bld\ifcopenshell_1559040198341\_test_env\lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 17, in <module>
_ifcopenshell_wrapper = swig_import_helper()
File "C:\Miniconda\conda-bld\ifcopenshell_1559040198341\_test_env\lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 16, in swig_import_helper
return importlib.import_module('_ifcopenshell_wrapper')
File "C:\Miniconda\conda-bld\ifcopenshell_1559040198341\_test_env\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_ifcopenshell_wrapper'
but _ifcopenshell_wrapper.pyd should be installed correctly.
-- Installing: C:/Miniconda/conda-bld/ifcopenshell_1559040198341/_h_env/Lib/site-packages/ifcopenshell/ifcopenshell_wrapper.py
-- Installing: C:/Miniconda/conda-bld/ifcopenshell_1559040198341/_h_env/Lib/site-packages/ifcopenshell/_ifcopenshell_wrapper.pyd
[1] https://github.com/conda-forge/conda-forge.github.io/issues/778
[2] https://github.com/FreeCAD/FreeCAD/commit/9369816f3ca31949bb59204b062ace12d821d2b8
Thanks again!
Ah that's correct. This is more or less setup in IfcOpenShell as well, but it is detected based on the LDFLAGS env var. https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcwrap/CMakeLists.txt#L57
Have a look at the build.sh in the repo how we addressed that https://github.com/IfcOpenBot/IfcOpenShell/blob/v0.6.0/conda/build.sh#L10
NameError: name '_newclass' is not defined
_newclass was some backwards compatibiluty thing in SWIG for python versions as old as 2.4 IIRC. I'll have a look, perhaps that has been removed at some point.
but _ifcopenshell_wrapper.pyd should be installed correctly.
Yes that's odd. I'll look into it.
Yes that's odd. I'll look into it.
It seems the module is built two times:
~
Resolved dependencies, will be built in the following order:
ifcopenshell-v0.6.0-cxx_compiler_vs2015-python_3.7-c_compiler_vs2015-on-win-64
ifcopenshell-v0.6.0-cxx_compiler_vs2015-python_3.6-c_compiler_vs2015-on-win-64
~
and the first one appears to be successful:
~~~
(%PREFIX%) %SRC_DIR%>"%PREFIX%\python.exe" -s "%SRC_DIR%\run_test.py"
import: 'ifcopenshell'
import: 'ifcopenshell'
(%PREFIX%) %SRC_DIR%>IF 0 NEQ 0 exit 1
Resource usage statistics from testing ifcopenshell:
Process count: 1
CPU time: unavailable
Memory: 1.9M
Disk usage: 665B
Time elapsed: 0:00:02.0
TEST END: C:\Minicondaconda-bld\win-64\ifcopenshell-v0.6.0-py37h1263861_0.tar.bz2
Renaming work directory, C:\Minicondaconda-bld\ifcopenshell_1559053884846\work to C:\Minicondaconda-bld\ifcopenshell_1559053884846\work_moved_ifcopenshell-v0.6.0-py37h1263861_0_win-64_main_build_loop
Skipped: ifcopenshell from D:\a\1\s\recipes\ifcopenshell defines build/skip for this configuration ({'boost_cpp': '1.68.0', 'libxml2': '2.9', 'cxx_compiler': 'vs2008', 'python': '2.7', 'c_compiler': 'vs2008', 'icu': '58', 'occt': '7.3'}).
Renaming work directory, C:\Minicondaconda-bld\ifcopenshell_1559053884846\work to C:\Minicondaconda-bld\ifcopenshell_1559053884846\work_moved_ifcopenshell-v0.6.0-py27h294ab33_0_win-64_main_build_loop
Collecting package metadata: ...working... done
Solving environment: ...working... done
Collecting package metadata: ...working... done
Solving environment: ...working... done
BUILD START: ['ifcopenshell-v0.6.0-py36h1263861_0.tar.bz2']
~~~
The issue seems to be the following:
~
-- Found PythonLibs: C:/hostedtoolcache/windows/Python/3.7.2/x64/libs/python37.lib (found version "3.7.2")
-- PYTHON_DEBUG_LIBRARIES not found, defining SWIG_PYTHON_INTERPRETER_NO_DEBUG workaround for IfcWrap.
-- Found PythonInterp: C:/Miniconda/conda-bld/ifcopenshell_1559053884846/_h_env/python.exe (found version "3.6.7")
~
I.e. CMake finds some random 3.7 python lib while it should be building against 3.6 the second time.
I think you'll need to tell CMake what Python version to use, like we do in the scripts in the repo: https://github.com/IfcOpenBot/IfcOpenShell/blob/v0.6.0/conda/bld.bat#L14
very good, windows works now.
linux:
import: 'ifcopenshell'
Traceback (most recent call last):
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559063392961/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 47, in <module>
from . import ifcopenshell_wrapper
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559063392961/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 188, in <module>
class Material(object):
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559063392961/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 242, in Material
if _newclass:
NameError: name '_newclass' is not defined
----------------------------------------------------------------
Traceback (most recent call last):
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559063392961/test_tmp/run_test.py", line 2, in <module>
import ifcopenshell
File "/home/conda/feedstock_root/build_artifacts/ifcopenshell_1559063392961/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 55, in <module>
raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'linux/64bit/python2.7'
osx:
import: 'ifcopenshell'
Traceback (most recent call last):
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559063452055/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 47, in <module>
from . import ifcopenshell_wrapper
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559063452055/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 188, in <module>
class Material(object):
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559063452055/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python2.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 242, in Material
if _newclass:
NameError: name '_newclass' is not defined
----------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559063452055/test_tmp/run_test.py", line 2, in <module>
import ifcopenshell
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559063452055/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python2.7/site-packages/ifcopenshell/__init__.py", line 55, in <module>
raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'darwin/64bit/python2.7'
Should I skip python2?
NameError: name '_newclass' is not defined
It's hard to figure out exactly, but it seems the _newclass think is backwards compatibility for Python 2.2. https://stackoverflow.com/questions/4015417/python-class-inherits-object/9448136
I just went ahead and removed everything related to it. Can you try again with the latest commit d535cf022202d0039e2b8ca44351cae57062d74a?
there is still a error about wrong python version (osx, linux)
import: 'ifcopenshell'
Traceback (most recent call last):
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559309576142/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python3.7/site-packages/ifcopenshell/__init__.py", line 47, in <module>
from . import ifcopenshell_wrapper
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559309576142/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python3.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 788, in <module>
class FileDescription(HeaderEntity):
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559309576142/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python3.7/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 812, in FileDescription
__swig_getmethods__["description"] = description
NameError: name '__swig_getmethods__' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559309576142/test_tmp/run_test.py", line 2, in <module>
import ifcopenshell
File "/usr/local/miniconda/conda-bld/ifcopenshell_1559309576142/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/python3.7/site-packages/ifcopenshell/__init__.py", line 55, in <module>
raise ImportError("IfcOpenShell not built for '%s'" % python_distribution)
ImportError: IfcOpenShell not built for 'darwin/64bit/python3.7'
If I look at the conda-forge entries for SWIG, I indeed see a difference between the Win and Linux/OSX versions. The former v3 and the later v4 https://anaconda.org/conda-forge/swig/files
How do you feel about specifying a version less than 4 for the SWIG dependency in this recipe? That'll probably fix this issue for the time being.
Hmm, I didn't had big problems with swig4.0.0 for other projects (pivy https://github.com/conda-forge/pivy-feedstock) We can try it.
Seems somebody else run into the same issue:
https://forum.freecadweb.org/viewtopic.php?t=30674
Congratulations, swig 3 really did the trick. Everything is green now. :+1:
To finalize the PR it would be nice to have a alpha release of the current 0.6 branch.
Thanks for your effort on this :)
To finalize the PR it would be nice to have a alpha release of the current 0.6 branch.
Yes, as said the timeline for this is quite good as I was planning releases anyway. Do you prefer another alpha immediately or can you wait two weeks for the beta?
Yes, as said the timeline for this is quite good as I was planning releases anyway. Do you prefer another alpha immediately or can you wait two weeks for the beta?
Better to wait for a beta release. The process to get a recipe accepted will also take some time.
Just tagged v0.6.0b0. Hope it goes through ok now and again thanks for your efforts on this.
https://github.com/IfcOpenShell/IfcOpenShell/releases/tag/v0.6.0b0
thanks a package for v0.6.0b0 is now available from conda-forge:
conda install ifcopenshell -c conda-forge
feedstock:
https://github.com/conda-forge/ifcopenshell-feedstock
Is conda-forge now recommended over the ifcopenshell channel?
https://anaconda.org/conda-forge/ifcopenshell
https://anaconda.org/ifcopenshell/ifcopenshell
Yes probably good question. There are still some differences, e.g. ifcopenshell channel is statically linked. But unless there are massive protests I will likely delete the channel at some point.
Most helpful comment
thanks a package for v0.6.0b0 is now available from conda-forge:
conda install ifcopenshell -c conda-forgefeedstock:
https://github.com/conda-forge/ifcopenshell-feedstock
packages:
https://anaconda.org/conda-forge/ifcopenshell