Skip to content

Commit

Permalink
save what I have before moving to cmake-for-ant
Browse files Browse the repository at this point in the history
  • Loading branch information
hughperkins committed Jul 17, 2013
1 parent 81c5bd3 commit a393312
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,7 +2,7 @@
*.so
*.dll

# bamboo files
# junit output files
TEST-*

# Package Files #
Expand Down
35 changes: 31 additions & 4 deletions README.md
Expand Up @@ -24,16 +24,16 @@ Example usage, to multiply two matrices:
DenseMatrix C = A.mmul(B); // mmul is matrix multiplication
System.out.println(C); // displays C formatted appropriately

How to build
============
How to build, linux
===================

Pre-requisites
--------------

- git
- ant
- cmake
- a c++ compiler, eg "g++" on linux, or Visual Studio C++ Express on Windows
- g++

Procedure
---------
Expand All @@ -43,7 +43,34 @@ Procedure
3. ant

Jeigen.jar will be created in the "jar" directory, and libjeigen.so
(or jeigen.dll) will be created in the build/native directory.
will be created in the build/native directory.

How to build, Windows
=====================

Pre-requisites
--------------

- have installed git
- have installed ant
- have installed cmake
- have installed Visual Studio C++ Express 2010

Procedure
---------

1. git clone git://github.com/hughperkins/jeigen.git
2. cd jeigen
3. set PATH=%PATH%;c:\apache-ant\bin
* set to appropriate path for your ant installation
4. C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
* Use appropriate path for your system
5. ant -DCMAKE_HOME="c:\program files\Cmake-2.8.2"
* set to appropriate path for your cmake installation
* if anything goes wrong, you can delete the entire 'build' directory, and try again from the beginning, if you want

Jeigen.jar will be created in the "jar" directory, and libjeigen.dll
will be created in the build/native directory.

How to link to Jeigen
=====================
Expand Down
31 changes: 30 additions & 1 deletion build.xml
Expand Up @@ -5,10 +5,38 @@
<pathelement path="thirdparty/jna.jar"/>
</path>

<!--
<taskdef name="cmake"
classname="org.iainhull.ant.CmakeBuilder" classpath="thirdparty/cmakeant.jar " />
-->
<target name="getos">
<echo message="${os.family}" />
<echo message="${os.name}" />
<condition property="iswindows">
<os family="windows" />
</condition>
<condition property="isunix">
<os family="unix" />
</condition>
</target>

<target name="cmake-linux" depends="getos" if="isunix">
<mkdir dir="build/native"/>
<exec executable="cmake" dir="build/native">
<arg line="-D CMAKE_BUILD_TYPE:STRING=Release ../../src/native" />
</exec>
</target>

<target name="cmake-windows" depends="getos" if="iswindows">
<property environment="env"/>
<mkdir dir="build/native"/>
<exec executable="${CMAKE_HOME}\bin\cmake" dir="build/native" searchpath="true" vmlauncher="true">
<arg line="-G 'Visual Studio 10' -D CMAKE_BUILD_TYPE:STRING=Release ../../src/native" />
</exec>
</target>

<target name="compile">
<target name="compile" depends="cmake-linux,cmake-windows">
<!--
<cmake srcdir="src/native"
bindir="build/native"
buildtype="Release" >
Expand All @@ -20,6 +48,7 @@
<generator name="Unix Makefiles" />
<readvar name="CMAKE_CXX_COMPILER" property="cxxCompilerPath" />
</cmake>
-->
<mkdir dir="build/classes"/>
<javac srcdir="src/java" destdir="build/classes" debug="true" >
<classpath refid="project.class.path" />
Expand Down

0 comments on commit a393312

Please sign in to comment.