-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Requesting FreeBSD support for Python library #2105
Comments
Could you try to build out of the source ? CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake -DBUILD_DEPS=ON -DBUILD_PYTHON=ON -S. -Bbuild
cmake --build build
python3.7 -m pip install --find-links=build/python/dist ortools inspired by Line 178 in 92fd9c5
did you manage to run test ? |
Running At the second step, when I run
|
can you try to find where "google/protobuf/duration.proto" is located ? find build -type f -iname "duration.proto" |
It's located in |
If I run:
The above error is solved, but then I see another error:
If I comment out the line Then I see another error later in the build:
If I change the line to The build succeeds. If I then run I see:
It appears to have installed successfully. |
wow thanks a lot !
## Get Protobuf include dir
get_target_property(protobuf_dirs protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir IN LISTS protobuf_dirs)
if ("${dir}" MATCHES "BUILD_INTERFACE")
message(STATUS "Adding proto path: ${dir}")
list(APPEND PROTO_DIRS "--proto_path=${dir}")
endif()
endforeach() It is done in cmake/cpp.cmake but not in python/java/dotnet, on my way to fix it...
|
__FreeBSD__
Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53
00
Le ven. 17 juil. 2020 à 09:52, Mizux <notifications@github.com> a écrit :
… wow thanks a lot !
1. For proto path, I may have found the issue, need to add
## Get Protobuf include dirget_target_property(protobuf_dirs protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)foreach(dir IN LISTS protobuf_dirs)
if ("${dir}" MATCHES "BUILD_INTERFACE")
message(STATUS "Adding proto path: ${dir}")
list(APPEND PROTO_DIRS "--proto_path=${dir}")
endif()endforeach()
It is done in cmake/cpp.cmake but not in python/java/dotnet, on my way to
fix it...
1. For struct fenv_t and endian.h it seems BSD has it own version
e.g.
https://git-01.md.hardenedbsd.org/HardenedBSD/HardenedBSD/src/commit/e4fe27d62783ed280e0c7f5a0eba0d62f8911cbd/lib/msun/powerpc/fenv.h
@lispmac <https://github.com/lispmac> do you know if there is a
preprocessor macro to check if we are on BSD so we can fix the code ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3P5DYFENKW3OOSFXO3R377KJANCNFSM4O3BU64A>
.
|
Here, my $ cat Vagrantfile | sed "/^ *#/d" | sed "/^ *$/d"
Vagrant.configure("2") do |config|
config.vm.guest = :freebsd
config.vm.box = "freebsd/FreeBSD-11.4-STABLE"
config.ssh.shell = "sh"
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.provision "shell", inline: <<-SHELL
set -x
pkg update -f
pkg install -y git cmake
git clone -b master https://github.com/google/or-tools.git
cd or-tools
cmake -S. -Bbuild -DBUILD_DEPS=ON
cmake --build build
set -x
SHELL
end Few dev notes:
$ vagrant destroy
$ export VAGRANT_EXPERIMENTAL="dependency_provisioners"
$ vagrant up
...
default: /home/vagrant/or-tools/build/_deps/cgl-src/Cgl/src/CglLandP/CglLandPUtils.hpp
default: :
default: 88
default: :
default: 25
default: :
default:
default: error
default: :
default: reinterpret_cast from 'nullptr_t' to 'OsiRowCut *' is not allowed
default: cuts_.resize(i, reinterpret_cast<OsiRowCut *> (NULL));
default: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
default: 1
default: error
default: generated |
The On amd64, So, the
Regarding the Below is the
Note that the provisioning script above also builds and installs the python package.
|
I'll try to add the patch ASAP in the same time I'll try to fix the clang issue which seems to follow coin-or/Clp#93 |
I've tested the above |
FYI:
Vagrant.configure("2") do |config|
config.vm.guest = :freebsd
config.vm.box = "generic/freebsd12"
config.ssh.shell = "sh"
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.provision "env", type: "shell", inline:<<-SHELL
set -x
pkg update -f
pkg install -y git cmake vim
SHELL
config.vm.provision "devel", type: "shell", inline:<<-SHELL
set -x
git clone --depth 1 --branch 20200225.2 https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
SHELL
config.vm.provision "configure", type: "shell", inline:<<-SHELL
set -x
cd abseil-cpp
cmake -S. -Bbuild -DABSL_USE_GOOGLETEST_HEAD=ON -DABSL_RUN_TESTS=ON
SHELL
config.vm.provision "build", type: "shell", inline:<<-SHELL
set -x
cd abseil-cpp
cmake --build build -v
SHELL
end On my way to create a hello world CMake project which only link against absl-cpp to verify this assertion, unfortunately abseil-cpp didn't work with
[0]─[~/work/master/build/_deps]
[^v^]─mizux@nuc10i7 %grepc -Rin "backtrace(" *-src
absl-src/absl/debugging/internal/stacktrace_generic-inl.inc:44: backtrace(unused_stack, 1);
absl-src/absl/debugging/internal/stacktrace_generic-inl.inc:62: size = backtrace(stack, kStackLength);
glog-src/src/stacktrace_windows-inl.h:47: return CaptureStackBackTrace(skip_count, max_depth, result, NULL);
glog-src/src/stacktrace_generic-inl.h:46: size = backtrace(stack, kStackLength);
glog-src/src/stacktrace_x86_64-inl.h:50:// Workaround for the malloc() in _Unwind_Backtrace() issue.
glog-src/src/stacktrace_x86_64-inl.h:51:static _Unwind_Reason_Code nop_backtrace(struct _Unwind_Context *uc, void *opq) {
glog-src/src/stacktrace_x86_64-inl.h:64: _Unwind_Backtrace(nop_backtrace, NULL);
glog-src/src/stacktrace_x86_64-inl.h:100: _Unwind_Backtrace(GetOneFrame, &targ); |
Strange, this morning using box My current investigationI wasn't able to reproduce the
note: both project were done using the So I suspect Fix HypothesisAn other potential fix, path to investigate, is both libraries (glog and absl-cpp), AFAIK, don't use the
ref: https://cmake.org/cmake/help/v3.18/module/FindBacktrace.html So i suspect the Abseil-cpp masterFYI, currently absl-cpp master HEAD is not compiling on FreeBSD see: abseil/abseil-cpp#744 |
What language and solver does this apply to?
Python
Describe the problem you are trying to solve.
I would like to be able to easily install ortools on FreeBSD using pip.
Describe the solution you'd like
I would like to be able to write
pip install ortools
on FreeBSD and have ortools be installed.Currently, running
pip install ortools
produces the following output on FreeBSD 12.1 STABLE:Describe alternatives you've considered
Approach 1:
I've tried installing the
py3-ortools
Python package viapip install py3-ortools
.However, running:
Produces error:
Approach 2:
I've tried to build the library from source on FreeBSD (which required the installation of cmake and gcc, the latter to avoid build errors related to dependencies).
The procedure was (in a Vagrant FreeBSD image):
The build succeeds.
Unfortunately, the following does not work for some reason (perhaps there are build steps that I am missing):
Which produces the following error:
Ideally one could just write
pip install ortools
and avoid the above entirely, just like on all the other major operating systems.The text was updated successfully, but these errors were encountered: