Skip to content

Windows & Visual Studio build scripts#5

Merged
aothms merged 32 commits into
IfcOpenShell:masterfrom
Tridify:windows_build_scripts
Nov 20, 2015
Merged

Windows & Visual Studio build scripts#5
aothms merged 32 commits into
IfcOpenShell:masterfrom
Tridify:windows_build_scripts

Conversation

@Stinkfist0

Copy link
Copy Markdown
Contributor

To-dos & known missing features:

  • CMakeLists.txt for IfcMax - after this the manually maintained solution files could be deleted. Should we also move CMakeLists.txt to the project root which seems to be typical for CMake-based projects?

Notes & Stuff for the future:

  • it would appear that CHECK_ADD_OCE_OCC_DEF() macro stuff could be removed altogether?
  • fix annoying LNK4049 warning spam coming from OpenCascade
  • fix GitHub dependencies to known good versions/tags instead of pulling latest always
  • Allow building ICU from the sources if user has Cygwin (which allows the next item)
  • Allow choosing whether to build the deps and IFCOS against static or dynamic MSVC run-time
  • How to enable whole program optimization & link-time code generation (ENABLE_BUILD_OPTIMIZATIONS ) for static libraries (IfcParse, IfcGeom) from CMakeLists.txt?

Summary:

  • Windows & Visual Studio build scripts for very effortless IfcOpenShell development environment setup. Greatly inspired the realXtend Tundra Windows & Visual Studio build scripts I've done work with. Ideally the project would probably have a single shared build script for all platforms (maybe written in Python?).
  • Debug and release builds of the dependencies can co-exist, allowing effortless switching between debug and release IfcOpenShell builds
  • ICU downloaded as prebuilt package (didn't really want to add Cygwin dependency that would be required for building ICU on Windows) that is built using static MSVC run-time.
    This means all other dependencies and IfcOpenShell itself is built accordingly too.
  • OCE and oce-win-bundle used from Tridify's forks (for now) in order to be able to build against static MSVC run-time
  • Added Boost.Regex and Thread (which require System and DateTime subsequently) to the required Boost libraries
  • Tested during the last few months on Windows 8.1 & 10 and VS 2013 & 2015 (both 32-bit and 64-bit builds), Python 2 & 3.
  • new CMake build options:
    • UNICODE_SUPPORT & COLLADA_SUPPORT for explicit control of whether the aforementioned features are wanted
    • ENABLE_BUILD_OPTIMIZATIONS for enforcing more aggressive optimizations (MSVC-only for now)
    • USE_IFC4 (defines USE_IFC4, otherwise USE_IFC2x3 is defined)
    • BUILD_IFCPYTHON & BUILD_EXAMPLES for more fine-grained control what the user wants in the project
    • fail fast instead of elusive warning prints if optional feature (Unicode, COLLADA, Python) requested and the required dependency is not found

screenshot 2015-11-19 18 10 23
screenshot 2015-11-19 18 13 40

@aothms

aothms commented Nov 5, 2015

Copy link
Copy Markdown
Member

Hi,

Many thanks again for your amazing contribution. Shall I wait for the additions you mentioned or just merge it in?

My main comment would be that I am not a big fan of the binaries in the utils/ folder. But I don't think such considerations have to play a big role now.

I think I will replace them with small python scripts some time after merging. What do you think of this idea? It should be fairly straightforward to emulate wget and 7z (for PKzip) in small python scripts, colored printing would be less straightforward unless a module like colorama is installed.

Kind regards,
Thomas

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

I would like to get the effortless Debug/Release switching in and after that this should be good for merging. Can you take care of the CMakeLists.txt for IfcMax (which should be trivial probably) as I don't have 3ds Max available? After this I think the old manually maintained solution files should/could be removed for good.

Ah yes, small Python scripts could be used to replace 7zip and wget, but if wanting to keep the build script fully automatized, how would we automatically install Python? PowerShell could be one option too. Or we could just ask the user to install Python manually as a prerequisite. For colored printing I'll see if I can find a non-executable replacement. If not, the whole coloring biz can be naturally omitted. EDIT: I might have found a batch file only replacement for cecho

… so that it's available for "autonomic" run-cmake.bat runs.
@aothms

aothms commented Nov 8, 2015

Copy link
Copy Markdown
Member

Sure, I will take care of IfcMax. I think to install Python manually as a prerequisite isn't a big problem, after all the compiler needs to be there as well.

…ibs + fix setting of PYTHON_INCLUDE_DIR + PYTHON_LIBRARY vars + small README.md cleanup.
…riable also in examples & qtviewer CMakeLists.txt
…tfix so that release and debug variants can co-exist in the same dir as is the default with OCE.
…owing effortless switching between IfcOpenShell debug and release builds.
…s for required features and continuing the build configuration, fail fast instead; user can easily disable the feature or fix the paths for the dependency.
@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Pending small cleanup (incl. text coloring biz rework) and after that I think this should be good for a merge!

@aothms

aothms commented Nov 12, 2015

Copy link
Copy Markdown
Member

Wonderful :)

…, fix Visual Studio download URL, rename IFCOS_NUM_BUILD_PROCESSES -> IFCOS_NUM_BUILD_PROCS
@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Usage instructions will be now printed upon error situations:
screenshot 2015-11-19 17 57 47
screenshot 2015-11-19 17 56 37

…g where.exe. Print instructions upon missing VS env vars or tools in PATH.
@Stinkfist0

Copy link
Copy Markdown
Contributor Author

OK, all the issues/notes with the exception of OpenCOLLADA + libxml2 are now handled, I'll try rebuilding OpenCOLLADA from the scratch to see if I can repro this issue. Edit: OpenCOLLADA built successfully. Edit2: screenshots in the original post updated.

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Would you like to me to create a clean PR so that we could get rid of the unnecessary wget and cecho binaries in the history?

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

OK, I think I found the reason why I don't have the LibXml2 problems you're having:

-- Could NOT find LibXml2 (missing:  LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
WARNING: Native LibXml2 not found, taking LibXml from ./Externals

You probably have your LibXml2 environment variables set and there are problems with arbitrary LibXml2 versions and OpenCOLLADA's current codebase?

@aothms

aothms commented Nov 19, 2015

Copy link
Copy Markdown
Member

Not necessary to create a new PR / rewrite history. If the repo becomes bloated due to history we can git-filter-branch later. For example, the IFC models will probably also be separated into a different repo some time.

I'll check the build log tomorrow, it's not my regular dev machine, so it's not immediately obvious where it would find a libxml somewhere, but never know for sure.

@aothms

aothms commented Nov 20, 2015

Copy link
Copy Markdown
Member

Yep, you were right

-- Found LibXml2: D:/downloads/gnuwin32/GetGnuWin32/gnuwin32/lib/libxml2.lib (found version "2.4.12") 
-- SUCCESSFUL: LibXml2 found
-- Found PCRE: D:/downloads/gnuwin32/GetGnuWin32/gnuwin32/include  
-- SUCCESSFUL: PCRE found

I don't understand how cmake is able to find this. Neither in FindLibXml2.cmake nor OpenCOLLADA/CMakeLists.txt I see easy ways to force cmake to stick the one that ships with OpenCOLLADA.

Any ideas?

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Maybe make the script to set LIBXML2_LIBRARIES and LIBXML2_INCLUDE_DIR to empty before CMake for OpenCOLLADA to enforce that the embedded version of LibXml2 is used? And probably best to do the same for PCRE too.

@aothms

aothms commented Nov 20, 2015

Copy link
Copy Markdown
Member

Yep, you're completely right. This works for me:

call :RunCMake -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%\OpenCOLLADA" -DUSE_STATIC_MSVC_RUNTIME=1 -DCMAKE_DEBUG_POSTFIX=d -DLIBXML2_LIBRARIES="" -DLIBXML2_INCLUDE_DIR="" -DPCRE_INCLUDE_DIR="" -DPCRE_LIBRARIES=""

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

OK, I'll add those.

…ml2 and PCRE are used as there might be problems with arbitrary versions of the libraries.
@Stinkfist0

Copy link
Copy Markdown
Contributor Author

OK, ready to go! I'll provide a new PR for possible further developments.

aothms added a commit that referenced this pull request Nov 20, 2015
Windows & Visual Studio build scripts
@aothms aothms merged commit 8164c90 into IfcOpenShell:master Nov 20, 2015
@aothms

aothms commented Nov 20, 2015

Copy link
Copy Markdown
Member

This is an amazing contribution. IfcOpenShell builds flawlessly. Thanks for all your efforts.

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Hmm, the formatting on the README.md's Compiling on Windows section seems a bit off. Edit: newlines before and after the cmd prompt biz section could maybe fix that.

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

BTW which Windows and VS versions you tested these with?

@aothms

aothms commented Nov 23, 2015

Copy link
Copy Markdown
Member

I tested with VS2015 CE on Windows 7.

@aothms

aothms commented Jan 9, 2016

Copy link
Copy Markdown
Member

Hey, made a small change to your script. I observed that git pull returned a non-zero exit code (at least my version on my system did) when there were no new changes. Made the script no longer halt in that case.

Also made some changes to CMake, but as far as my testing goes, that only affects *nix.

Check out the *nix buildscript btw in case you're interested.

aothms@18f8d7b

@Stinkfist0

Copy link
Copy Markdown
Contributor Author

Nice! BTW regarding Boost libs, system will be required for thread and date_time for regex. I'm using regex at the old branch, but not thread yet (I started toying around threading IfcConvert but had no time the get anything concrete running). So, those can be omitted now, but I'll be bringing back regex and date_time in the near future.

aothms pushed a commit that referenced this pull request Jan 23, 2019
Reorganised code, Boolean ops seem to work
red1oon added a commit to red1oon/IfcOpenShell that referenced this pull request Nov 19, 2025
NEW FEATURES:
- Report generation for proximity analysis results
  - generate_proximity_report() for single groups
  - generate_proximity_report_for_all_groups() for batch processing
  - JSON export with severity categorization
  - Discipline breakdown and impact summaries

TESTING:
- 10 Tier 2 integration tests (full workflow validation)
- 4 report generation tests
- Total: 24 tests passing (100% coverage)
- Execution: 0.26 seconds for entire suite

BUGS FIXED (Autonomous):
- Bug IfcOpenShell#5: Database connection leaks (7 instances fixed)
- Bug IfcOpenShell#6: Missing Path import in resolution_engine.py
- Bug IfcOpenShell#7: Relative import error in standalone context

IMPROVEMENTS:
- Connection management with context managers (prevent locks)
- Fallback imports for standalone testing
- Enhanced integration with existing workflow

TEST IMPACT ON POST-PROCESSES:
- Validates report generation can access persisted data
- Ensures re-entrant operations don't crash workflows
- Tests connection lifecycle for chained operations
- Validates data structures for visualization/reporting

VALIDATION:
- 7/7 bugs auto-fixed (100% success rate)
- 0 bugs in new code reached user
- Integration tests would have caught Bug IfcOpenShell#4 scenario
- All post-process workflows enabled and tested

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants