Package Errors

16 views
Skip to first unread message

Pardheev Krishna Tammineni

unread,
Dec 23, 2023, 7:27:15 AM12/23/23
to UniTime Discussion Group
I recently downloaded a code from the cpsolver repository on GitHub and attempted to run it on my system. However, I encountered some package errors that are hindering the execution. I am seeking assistance from the community to resolve these issues.
Details:
1. Code Repository: https://github.com/UniTime/cpsolver
2. Error Messages:
3. Steps to Reproduce: Tried running the IFS examples https://github.com/UniTime/cpsolver/blob/master/src/org/cpsolver/ifs/example/csp/Test.java

I appreciate any assistance or guidance the community can provide.
Thank you in advance!
WhatsApp Image 2023-12-23 at 17.54.24_14e0c660.jpg

Tomáš Müller

unread,
Dec 23, 2023, 8:01:44 AM12/23/23
to unitime...@googlegroups.com
Dear Pardheev,

The CPSolver can be built using Apache Ant or Maven.

First, you need to clone the Git repository:


Cloning into 'cpsolver'...
remote: Enumerating objects: 18019, done.
remote: Counting objects: 100% (893/893), done.
remote: Compressing objects: 100% (351/351), done.
remote: Total 18019 (delta 474), reused 846 (delta 433), pack-reused 17126
Receiving objects: 100% (18019/18019), 26.30 MiB | 9.87 MiB/s, done.
Resolving deltas: 100% (11176/11176), done.

Second, to build using Maven, execute mvm package in the cpsolver folder

cd cpsolver
mvn package

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< org.unitime:cpsolver >------------------------
[INFO] Building CPSolver 1.4-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
...
[INFO] Building jar: /Users/muller/Test/Build/cpsolver/target/cpsolver-1.4-SNAPSHOT-javadoc.jar
[INFO]
[INFO] --- assembly:2.3:single (make-assembly) @ cpsolver ---
[INFO] Reading assembly descriptor: distribution.xml
[INFO] Building zip: /Users/muller/Test/Build/cpsolver/target/cpsolver-1.4-SNAPSHOT-dist.zip
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.908 s
[INFO] Finished at: 2023-12-23T13:33:37+01:00
[INFO] ------------------------------------------------------------------------

The resultant JAR is placed in the target folder: target/cpsolver-1.4-SNAPSHOT.jar. It is also included inside of the target/cpsolver-1.4-SNAPSHOT-dist.zip distribution.

Or using Apache Ant calling ant in the cpsolver filter (root folder of the cpsolver repository):

cd cpsolver
ant
 
Buildfile: /users/muller/test/cpsolver/build.xml

clean:

init:
    [mkdir] Created dir: /Users/muller/Test/Build/cpsolver/tmp
    [mkdir] Created dir: /Users/muller/Test/Build/cpsolver/dist/bin
     [echo] Source files: /Users/muller/Test/Build/cpsolver/src
     [echo] Libs: /Users/muller/Test/Build/cpsolver/lib
...
dist:
    [mkdir] Created dir: /Users/muller/Test/Build/cpsolver/dist/lib
     [copy] Copying 3 files to /Users/muller/Test/Build/cpsolver/dist/lib
      [zip] Building zip: /Users/muller/Test/Build/cpsolver/dist/cpsolver-1.4_bld1.zip

The resultant JAR is under dist/bin/cpsolver-all-1.4.jar (or inside of the dist/cpsolver-1.4_bld1.zip).

For running the example, please place the cpsolver library in the same folder as the dependencies (dom4j-2.1.4.jar, log4j-api-2.20.0.jar, log4j-core-2.20.0.jar -- these are also included in the distribution zip file). For example:

java -Xmx1g -cp cpsolver-1.4-SNAPSHOT.jar org.cpsolver.ifs.example.csp.SimpleTest

Alternatively, you can include all the dependencies in the classpath. For example (using the locations from the Git repository and Maven build):

java -Xmx1g -cp target/cpsolver-1.4-SNAPSHOT.jar:lib/dom4j-2.1.4.jar:lib/log4j-api-2.20.0.jar:lib/log4j-core-2.20.0.jar org.cpsolver.ifs.example.csp.SimpleTest

java -Xmx1g -cp target/cpsolver-1.4-SNAPSHOT.jar:lib/dom4j-2.1.4.jar:lib/log4j-api-2.20.0.jar:lib/log4j-core-2.20.0.jar org.cpsolver.ifs.example.csp.Test csp-example.cfg

See the attached configuration csp-example.cfg.

Best regards,

Tomas Muller
UniTime

--
You received this message because you are subscribed to the Google Groups "UniTime Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unitime-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unitime-discuss/058d9c6a-02c9-44a5-9bf7-7f41c1455a03n%40googlegroups.com.
csp-example.cfg
Reply all
Reply to author
Forward
0 new messages