Skip to content

MSYS build scripts and instructions#99

Merged
aothms merged 12 commits into
IfcOpenShell:masterfrom
Tridify:msys
Jul 15, 2016
Merged

MSYS build scripts and instructions#99
aothms merged 12 commits into
IfcOpenShell:masterfrom
Tridify:msys

Conversation

@Stinkfist0

Copy link
Copy Markdown
Contributor

Opening up for an initial review; a commit or two probably pending.

@iras

iras commented Jul 4, 2016

Copy link
Copy Markdown
Contributor

Thanks @Stinkfist0.

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Closes #98 also

Comment thread cmake/CMakeLists.txt Outdated
find_package(Threads)
if (NOT APPLE)
set(LIB_RT "rt")
# TODO why OPENCASCADE_LIBRARIES is repeated three times below?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to resolve cyclic dependencies in gcc/ld. Better way seems to use --start-group ... --end-group, but didn't want to spend effort on it.

@aothms

aothms commented Jul 8, 2016

Copy link
Copy Markdown
Member

This is great thanks. Are there more commits pending? Don't really have the opportunity to test the changes, but they all look perfectly reasonable and since the bulk comprises build script additions, I am fine with merging as is.

@Stinkfist0

Stinkfist0 commented Jul 8, 2016

Copy link
Copy Markdown
Contributor Author

I'm having missing symbols errors for IfcPython build (Python is found successfully though - any tips?), but other than that this should be good to go.

@iras

iras commented Jul 8, 2016

Copy link
Copy Markdown
Contributor

Most of the warnings have gone when compiling in gcc. As @Stinkfist0 already pointed out there are some warnings re Python plus a few others singled out below here.

[ 27%] Building CXX object CMakeFiles/IfcParse.dir/home/i/git/IfcOpenShell-2/src/ifcparse/IfcHierarchyHelper.cpp.o /home/i/git/IfcOpenShell-2/src/ifcparse/Ifc2x3-latebound.cpp: In function ‘void InitDescriptorMap()’: /home/i/git/IfcOpenShell-2/src/ifcparse/Ifc2x3-latebound.cpp:2426:31: warning: variable ‘current_enum’ set but not used [-Wunused-but-set-variable] IfcEnumerationDescriptor* current_enum; ^

[ 33%] Building CXX object CMakeFiles/IfcParse.dir/home/i/git/IfcOpenShell-2/src/ifcparse/Ifc2x3.cpp.o /home/i/git/IfcOpenShell-2/src/ifcparse/IfcParse.cpp: In member function ‘IfcUtil::IfcBaseClass* IfcParse::IfcFile::addEntity(IfcUtil::IfcBaseClass*)’: /home/i/git/IfcOpenShell-2/src/ifcparse/IfcParse.cpp:1255:34: warning: ‘*((void*)& conversion_factor +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized] (*it) *= *conversion_factor; ^ Linking CXX static library libIfcParse.a

[ 97%] Building CXX object ifcwrap/CMakeFiles/_ifcopenshell_wrapper.dir/IfcPythonPYTHON_wrap.cxx.o /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp: In instantiation of ‘T sread(std::istream&) [with T = int; std::istream = std::basic_istream<char>]’: /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp:58:32: required from here /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp:53:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] return *((T*)buf); ^ /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp: In instantiation of ‘T sread(std::istream&) [with T = double; std::istream = std::basic_istream<char>]’: /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp:299:32: required from here /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp:53:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp: In instantiation of ‘T sread(std::istream&) [with T = unsigned int; std::istream = std::basic_istream<char>]’: /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp:315:26: required from here /home/i/git/IfcOpenShell-2/src/ifcgeomserver/IfcGeomServer.cpp:53:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

[100%] Built target IfcGeomServer /home/i/git/IfcOpenShell-2/src/ifcconvert/IfcConvert.cpp: In function ‘int main(int, char**)’: /home/i/git/IfcOpenShell-2/src/ifcconvert/IfcConvert.cpp:407:108: warning: ‘*((void*)& bounding_height +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized] static_cast<SvgSerializer*>(serializer)->setBoundingRectangle(*bounding_width, *bounding_height); ^ /home/i/git/IfcOpenShell-2/src/ifcconvert/IfcConvert.cpp:407:108: warning: ‘*((void*)& bounding_width +4)’ may be used uninitialized in this function [-Wmaybe-uninitialized] Linking CXX executable IfcConvert

@Stinkfist0

Stinkfist0 commented Jul 8, 2016

Copy link
Copy Markdown
Contributor Author

Yeah couple warnings left, I could maybe take a look of them now. E: or not... Trying these build scripts now using a clean MSYS2 installation at the office and OCE build fails at the very end:
g++.exe: error: CreateProcess: No such file or directory
E: forgot to pacman -Sy pacman, maybe that's the reason.

@Stinkfist0

Stinkfist0 commented Jul 10, 2016

Copy link
Copy Markdown
Contributor Author

Only GCC warning left (with the current warning level) should be dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] in IfcGeomServer.cpp, but I'll leave that for Thomas, as I don't want to fix it bindly (I don't have any experience in running and testing IfcGeomServer myself).

@iras

iras commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

Cool. Thank you @Stinkfist0. I recompiled it with gcc and I can confirm the only warning left is the one thrown by IfcGeomServer.cpp.

[ 86%] Building CXX object CMakeFiles/IfcGeomServer.dir/home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp.o /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp: In instantiation of ‘T sread(std::istream&) [with T = int; std::istream = std::basic_istream<char>]’: /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp:58:32: required from here /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp:53:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] return *((T*)buf); ^ /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp: In instantiation of ‘T sread(std::istream&) [with T = double; std::istream = std::basic_istream<char>]’: /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp:299:32: required from here /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp:53:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp: In instantiation of ‘T sread(std::istream&) [with T = unsigned int; std::istream = std::basic_istream<char>]’: /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp:315:26: required from here /home/i/git/IfcTest/src/ifcgeomserver/IfcGeomServer.cpp:53:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Thumbs up from me if you want to merge it @aothms.

@aothms

aothms commented Jul 15, 2016

Copy link
Copy Markdown
Member

Wonderful. I am still travelling, no time to check in detail, but looks good to me. Many many thanks.

@aothms aothms merged commit 4a85e5e into IfcOpenShell:master Jul 15, 2016
@iras iras mentioned this pull request Jul 19, 2016
Comment thread cmake/CMakeLists.txt
message(STATUS "ENABLE_BUILD_OPTIMIZATIONS not implemented for GCC/non-MSVC compilers.)")
# GCC-like: Release should use O3 but RelWithDebInfo 02 so enforce 03. Anything other useful that could be added here?
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -O3")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also experiment with -flto and -fwhole-program here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants