Comments (10)
SCIP_EXPORT
seems to get defined wrongly. It should be defined to __declspec(dllexport)
when using MSVC, but somehow you get the GCC/clang variant __attribute__((__visibility__("default")))
.
The place where SCIP_EXPORT
gets defined depends a bit on your SCIP installation. You might want to look into that.
from scip.
You can try whether changing the content to
#ifndef SCIP_EXPORT
#define SCIP_EXPORT __declspec(dllimport)
#endif
works better, assuming your want to link to a SCIP DLL later.
from scip.
Hi!,
I see SCIP_EXPORT
being exported in def.h
I'm including #include "scip/scip.h"
¿Do you have an idea of what can be going on?
As far as I know I have not messed with SCIP_EXPORT
.
from scip.
It gets defined in def.h
if it hasn't been defined already. Maybe you could just look at the code after the C preprocessor has been running (there should be some flag for MSVC to output this; it's -E
with gcc). That should show more clearly where SCIP_EXPORT
gets defined to which value.
My guess is that you have an installation of SCIP that was build via cmake on Linux. In the case, there is a scip/scip_export.h
somewhere which defines SCIP_EXPORT
to be __attribute__((visibility("default")))
, which will not work with MS compilers. But there is not enough information given here to say for sure what is happening.
from scip.
Indeed I have the file scip/scip_export.h
.
So this file should not be there for windows?
THe content of the file is:
#ifndef SCIP_EXPORT_H
#define SCIP_EXPORT_H
#ifdef SCIP_STATIC_DEFINE
# define SCIP_EXPORT
# define SCIP_NO_EXPORT
#else
# ifndef SCIP_EXPORT
# ifdef libscip_EXPORTS
/* We are building this library */
# define SCIP_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define SCIP_EXPORT __attribute__((visibility("default")))
# endif
# endif
# ifndef SCIP_NO_EXPORT
# define SCIP_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif
#ifndef SCIP_DEPRECATED
# define SCIP_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef SCIP_DEPRECATED_EXPORT
# define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED
#endif
#ifndef SCIP_DEPRECATED_NO_EXPORT
# define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef SCIP_NO_DEPRECATED
# define SCIP_NO_DEPRECATED
# endif
#endif
#endif /* SCIP_EXPORT_H */
Do you believe that it is ok to modify this to handle the OS config?
from scip.
That gets fixed, but I get the same issue with SCIP_DEPRECATED
.
What should be the windows version for that one?
Thanks
from scip.
Well this is scip_export.h
now:
#ifndef SCIP_EXPORT_H
#define SCIP_EXPORT_H
#ifdef SCIP_STATIC_DEFINE
//# define SCIP_EXPORT
# if defined(_WIN32) || defined(_WIN64)
# define SCIP_EXPORT __declspec(dllexport)
# elif defined(__APPLE__) || defined(LINUX) || defined(linux)
# define SCIP_EXPORT __attribute__((visibility("default")))
# endif
# define SCIP_NO_EXPORT
#else
# ifndef SCIP_EXPORT
# ifdef libscip_EXPORTS
/* We are building this library */
# if defined(_WIN32) || defined(_WIN64)
# define SCIP_EXPORT __declspec(dllexport)
# elif defined(__APPLE__) || defined(LINUX) || defined(linux)
# define SCIP_EXPORT __attribute__((visibility("default")))
# endif
# else
/* We are using this library */
# if defined(_WIN32) || defined(_WIN64)
# define SCIP_EXPORT __declspec(dllexport)
# elif defined(__APPLE__) || defined(LINUX) || defined(linux)
# define SCIP_EXPORT __attribute__((visibility("default")))
# endif
# endif
# endif
#ifndef SCIP_EXPORT
# if defined(_WIN32) || defined(_WIN64)
# define SCIP_EXPORT __declspec(dllimport)
# elif defined(__APPLE__) || defined(LINUX) || defined(linux)
# define SCIP_EXPORT __attribute__((visibility("default")))
# endif
#endif
# ifndef SCIP_NO_EXPORT
# define SCIP_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif
#ifndef SCIP_DEPRECATED
# if defined(_WIN32) || defined(_WIN64)
# define SCIP_DEPRECATED __declspec(deprecated)
# elif defined(__APPLE__) || defined(LINUX) || defined(linux)
# define SCIP_DEPRECATED __attribute__ ((__deprecated__))
# endif
#endif
#ifndef SCIP_DEPRECATED_EXPORT
# define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED
#endif
#ifndef SCIP_DEPRECATED_NO_EXPORT
# define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef SCIP_NO_DEPRECATED
# define SCIP_NO_DEPRECATED
# endif
#endif
#endif /* SCIP_EXPORT_H */
It works as horrific it may be...
from scip.
@svigerske is that a change we should also do upstream?
from scip.
No, this looks like a user doing something wrong, but not telling enough to find the source of the problem. I gave my guess and instructions to investigate, but that seemed to have been ignored. Since the user found a workaround, this can be closed.
The scip_export.h
is autogenerated during the build if using cmake. So you won't need one that works for both worlds (MSVC and GCC). Also, the scip_export.h
in https://www.scipopt.org/download.php?fname=SCIPOptSuite-8.0.4-win64-VS15.exe looks correct:
#ifndef SCIP_EXPORT_H
#define SCIP_EXPORT_H
#ifdef SCIP_STATIC_DEFINE
# define SCIP_EXPORT
# define SCIP_NO_EXPORT
#else
# ifndef SCIP_EXPORT
# ifdef libscip_EXPORTS
/* We are building this library */
# define SCIP_EXPORT __declspec(dllexport)
# else
/* We are using this library */
# define SCIP_EXPORT __declspec(dllimport)
# endif
# endif
# ifndef SCIP_NO_EXPORT
# define SCIP_NO_EXPORT
# endif
#endif
#ifndef SCIP_DEPRECATED
# define SCIP_DEPRECATED __declspec(deprecated)
#endif
#ifndef SCIP_DEPRECATED_EXPORT
# define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED
#endif
#ifndef SCIP_DEPRECATED_NO_EXPORT
# define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef SCIP_NO_DEPRECATED
# define SCIP_NO_DEPRECATED
# endif
#endif
#endif /* SCIP_EXPORT_H */
(MSVC-style __declspec
instead of GCC-style __attribute__
)
from scip.
Just to provide a bit of context.
What I am doing is to copy the headers in a folder called ThridParty/solvers/scip/8.0.3
because later I dynamically search and load the .dll/.so file. This is being done with other libraries with zero issues.
Why?
Because I want to be able to compile binaries with all the functionality without having to rely on the machine. I know a common practice is to use cmake to download the dependencies. But that has not worked great in the past and I need to provide a compilable source code to several environments with minimal dependencies (cmake, gcc/msvc and that's it)
I see from the comments, that what I should have is two sets of scip header; one for windows and one for unix. I really believe this is overkill, given that the only difference is a file.
Just my 2 cents.
from scip.
Related Issues (20)
- Assertion failed at the end of a solve HOT 3
- Data race in interrupt.c HOT 4
- ImportError: libscip.so.8.0: cannot open shared object file: No such file or directory HOT 1
- Suboptimal MIP solution reported as optimal HOT 2
- Can you build binary package for a more recent liunx distribution? HOT 3
- SegFault after compiling HOT 5
- Coloring application Branching Rule contradictory code HOT 7
- 2 tests fail HOT 1
- lot of tests from viprchk and «ctest -R MIPEX» failed on «exact-rational» branch HOT 9
- RFE: dynamic line length HOT 6
- question: how not to use nlpi_ipopt which depend on proprietray libhsl.so? HOT 3
- Interesting paper HOT 1
- `RelWithDebInfo` build is still asserting. HOT 4
- question: compiled with GMP=on, how to ensure GMP is used with CVXPY? HOT 3
- Difference in the objective value of a MIP in version 8.1.0 HOT 3
- What are the uses of nauty in SCIP? HOT 4
- System.AccessViolationException when trying to delete a restriction after LPError HOT 1
- Highs interface, option values function call deprecated HOT 1
- Adding constraint improves objective. HOT 4
- Request: Publish debs for aarch64
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scip.