Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opencascade] Fix static build #14901

Merged
merged 7 commits into from Dec 5, 2020
Merged

Conversation

JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Dec 2, 2020

  • Enable static build.
  • Fix build with Visual Studio 2017
  • Fix dependency freetype

Fixes #14874.

Already tested all features in x64-windows and x64-windows-static successfully.

@JackBoosY JackBoosY added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:internal This PR or Issue was filed by the vcpkg team. labels Dec 2, 2020
@JackBoosY
Copy link
Contributor Author

@fauder Can you test this PR?

Thanks.

@fauder
Copy link

fauder commented Dec 2, 2020

@fauder Can you test this PR?

Thanks.

Thank you for taking the time to fix this.

What I did:

  • Cloned vcpkg into a fresh directory.
  • pulled your pr with git fetch origin pull/14901/head:dev/jack/14874.
  • git checkout dev/jack/14874.
  • Don't know if was necessary but I ran bootstrap.sh and vcpkg integrate install anyways.
  • vcpkg install opencascade:x64-windows-static.

Build failed unfortunately:
(Omitting the successfull build of 5 dependencies)

Starting package 6/6: opencascade:x64-windows-static
Building package opencascade[core]:x64-windows-static...
-- Downloading https://github.com/Open-Cascade-SAS/OCCT/archive/V7_4_0.tar.gz...
-- Extracting source C:/Users/Burak/Desktop/vcpkg-test/vcpkg/downloads/Open-Cascade-SAS-OCCT-V7_4_0.tar.gz
-- Applying patch fix-msvc-32bit-builds.patch
-- Applying patch fix-static-build.patch
-- Using source at C:/Users/Burak/Desktop/vcpkg-test/vcpkg/buildtrees/opencascade/src/V7_4_0-3a470d68c8.clean
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
-- Building x64-windows-static-rel
CMake Error at ports/opencascade/portfile.cmake:51 (file):
  file RENAME failed to rename

    C:/Users/Burak/Desktop/vcpkg-test/vcpkg/packages/opencascade_x64-windows-static/debug/bind

  to

    C:/Users/Burak/Desktop/vcpkg-test/vcpkg/packages/opencascade_x64-windows-static/debug/bin

  because: No such file or directory

Call Stack (most recent call first):
  scripts/ports.cmake:136 (include)


Error: Building package opencascade:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: opencascade:x64-windows-static
  Vcpkg version: 2020.11.12-nohash

Additionally, attach any relevant sections from the log files above.

@fauder
Copy link

fauder commented Dec 3, 2020

Pulled f58bacb and tried again and got errors:

Computing installation plan...
The following packages will be built and installed:
    opencascade[core]:x64-windows-static -> 7.4.0#2
Detecting compiler hash for triplet x64-windows-static...
Could not locate cached archive: C:\Users\Burak\AppData\Local\vcpkg\archives\a0\a0eafdba50e48d441b9c5192b4b5647ac2682625.zip
Starting package 1/1: opencascade:x64-windows-static
Building package opencascade[core]:x64-windows-static...
-- Using cached C:/Users/Burak/Desktop/vcpkg-test/vcpkg/downloads/Open-Cascade-SAS-OCCT-V7_4_0.tar.gz
-- Extracting source C:/Users/Burak/Desktop/vcpkg-test/vcpkg/downloads/Open-Cascade-SAS-OCCT-V7_4_0.tar.gz
-- Applying patch fix-msvc-32bit-builds.patch
-- Applying patch fix-static-build.patch
-- Using source at C:/Users/Burak/Desktop/vcpkg-test/vcpkg/buildtrees/opencascade/src/V7_4_0-bb62db8ee1.clean
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
-- Building x64-windows-static-rel
-- Installing: C:/Users/Burak/Desktop/vcpkg-test/vcpkg/packages/opencascade_x64-windows-static/share/opencascade/copyright
-- Performing post-build validation
There should be no bin\ directory in a static build, but C:\Users\Burak\Desktop\vcpkg-test\vcpkg\packages\opencascade_x64-windows-static\bin is present.
There should be no debug\bin\ directory in a static build, but C:\Users\Burak\Desktop\vcpkg-test\vcpkg\packages\opencascade_x64-windows-static\debug\bin is present.
If the creation of bin\ and/or debug\bin\ cannot be disabled, use this in the portfile to remove them

    if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
        file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
    endif()

Found 1 error(s). Please correct the portfile:
    C:\Users\Burak\Desktop\vcpkg-test\vcpkg\ports\opencascade\portfile.cmake
-- Performing post-build validation done
Error: Building package opencascade:x64-windows-static failed with: POST_BUILD_CHECKS_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: opencascade:x64-windows-static
  Vcpkg version: 2020.11.12-nohash

Additionally, attach any relevant sections from the log files above.

@JackBoosY
Copy link
Contributor Author

@fauder I will ping you when I finish this PR.

@fauder
Copy link

fauder commented Dec 3, 2020

@fauder I will ping you when I finish this PR.

Sure.

@JackBoosY JackBoosY marked this pull request as ready for review December 4, 2020 06:31
@JackBoosY
Copy link
Contributor Author

@fauder Ready

#include <stdlib.h>

- #ifdef _MSC_VER
- #pragma comment (lib, "freetype.lib")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already set to link in cmake.

@PhoebeHui PhoebeHui added the info:reviewed Pull Request changes follow basic guidelines label Dec 4, 2020
@fauder
Copy link

fauder commented Dec 4, 2020

@fauder Ready

It builds without any errors on a fresh vcpkg clone 👍 I'll wait for it to be merged to try it on my actual vcpkg directory. It took 40 minutes sheesh.

Thanks a lot by the way.

@BillyONeal BillyONeal merged commit d090a3e into microsoft:master Dec 5, 2020
@BillyONeal
Copy link
Member

Thanks for your help!

@JackBoosY JackBoosY deleted the dev/jack/14874 branch December 7, 2020 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenCascade dynamic build (everything else static) error.
5 participants