scipopt / JSCIPOpt

Java interface for the SCIP Optimization Suite
MIT License
62 stars 35 forks source link

build deprecation warnings #47

Closed svigerske closed 2 days ago

svigerske commented 3 months ago

When building with current SCIP bugfix branch (v91-bugfix) on a Debian12 system, there are several warnings:

17:58:56 + cmake .. -DSCIP_DIR=/scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/build/scip
17:58:56 CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required):
17:58:56   Compatibility with CMake < 2.8.12 will be removed from a future version of
17:58:56   CMake.
17:58:56 
17:58:56   Update the VERSION argument <min> value or use a ...<max> suffix to tell
17:58:56   CMake that the project does not need compatibility with older versions.
17:58:56 
17:58:56 
17:58:56 -- The C compiler identification is GNU 12.2.0
17:58:56 -- The CXX compiler identification is GNU 12.2.0
17:58:56 -- Detecting C compiler ABI info
17:58:56 -- Detecting C compiler ABI info - done
17:58:56 -- Check for working C compiler: /usr/lib/ccache/cc - skipped
17:58:56 -- Detecting C compile features
17:58:56 -- Detecting C compile features - done
17:58:56 -- Detecting CXX compiler ABI info
17:58:57 -- Detecting CXX compiler ABI info - done
17:58:57 -- Check for working CXX compiler: /usr/lib/ccache/c++ - skipped
17:58:57 -- Detecting CXX compile features
17:58:57 -- Detecting CXX compile features - done
17:58:57 -- Found JNI: /usr/lib/jvm/default-java/include  found components: JVM 
17:58:57 -- Found Java: /usr/bin/java (found version "17.0.11") 
17:58:57 -- Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) 
17:58:57 libscip is a SHARED_LIBRARY.
17:58:57 -- Configuring done
17:58:57 -- Generating done
17:58:57 -- Build files have been written to: /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/JSCIPOpt/build
17:58:57 + make -j4
17:58:57 [  9%] Building Java objects for scipjar.jar
17:58:57 [ 18%] Building CXX object CMakeFiles/jscip.dir/src/scipjni_wrap.cxx.o
17:58:59 [ 27%] Generating CMakeFiles/scipjar.dir/java_class_filelist
17:58:59 [ 36%] Creating Java archive scip.jar
17:58:59 [ 36%] Built target scipjar
17:58:59 [ 45%] Building Java objects for examples.jar
17:58:59 In file included from /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/scip/src/scip/scip.h:44,
17:58:59                  from /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/JSCIPOpt/src/scipjni_wrap.cxx:753:
17:58:59 /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/JSCIPOpt/src/scipjni_wrap.cxx: In function ‘SCIP_CONS* createConsBasicQuadratic(SCIP*, const char*, int, SCIP_VAR**, double*, int, SCIP_VAR**, SCIP_VAR**, double*, double, double)’:
17:58:59 /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/JSCIPOpt/src/scipjni_wrap.cxx:867:52: warning: ‘SCIP_RETCODE SCIPcreateConsBasicQuadratic(SCIP*, SCIP_CONS**, const char*, int, SCIP_VAR**, double*, int, SCIP_VAR**, SCIP_VAR**, double*, double, double)’ is deprecated [-Wdeprecated-declarations]
17:58:59   867 |       SCIP_CALL_ABORT( SCIPcreateConsBasicQuadratic(scip, &cons, name, nlinvars, linvars, lincoefs, nquadvars, quadvars1, quadvars2, quadcoefs, lhs, rhs) );
17:58:59       |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:58:59 In file included from /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/JSCIPOpt/src/scipjni_wrap.cxx:755:
17:58:59 /scratch/opt/jenkins/workspace/SCIPOptSuite_test_interfaces/scipoptsuite-9.1.1/scip/src/scip/cons_quadratic.h:124:14: note: declared here
17:58:59   124 | SCIP_RETCODE SCIPcreateConsBasicQuadratic(
17:58:59       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

This deprecation is since SCIP 8.0.0 !

kkofler commented 3 months ago

Well, JSCIP is released separately from SCIP and generally does not require you to use the latest version of SCIP. So I saw little point in applying this method rename, possibly with some #ifdef mess, when the old names are still working. But I guess I can do the change now, I doubt anyone still wants to use SCIP 7.x.x by now, so we can just use the new name and be done with it now. I will do that ~2 weeks from now after my paid time off, unless someone beats me to it.

svigerske commented 3 months ago

Thanks. No hurry. The old function may just be removed at some point.

kkofler commented 3 months ago

Makes sense.

kkofler commented 3 weeks ago

Turns out the current JSCIPOpt does not build with SCIP < 8.0.0 anyway, so I might as well just switch to the non-deprecated functions here.

kkofler commented 3 weeks ago

(See #50.)