Difference between revisions of "ApCoCoA-1:HowTo:Compile ApCoCoALib on Windows"

From ApCoCoAWiki
(added content)
m (Bot: Replacing category HowTo with HowTo Old)
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Info=
+
This page is outdated, please see [[ApCoCoALib:CompilationInstructions]]
  
Based on the discussion on 22.11.2007 with Michael this page will contain a brief description on how to compile the ApCoCoALib under Windows.
+
=Introduction=
 +
*This site is set up to collect all necessary bits and pieces to compile the ApCoCoALib on Windows.
 +
*This description is made for compiling the ApCoCoALib with MSVC 2003/2005.
  
Note: The compilation as described below will fail on the current repository version. The description only presents the general approach which will be made available with the next releases.
+
=Preparation=
 +
Before compiling the ApCoCoALib you need to install the following files/libraries:
  
= What is needed =
+
*CoCoALib: The ApCoCoALib is based on and extends the functionalities of the CoCoALib. You need to compile the CoCoALib prior to the ApCoCoALib.
In order to compile the ApCoCoALib on Windows several programs need to be installed prior compilation. The installation and reference of those programs will not described on this site. We refer to the official websites instead.
+
**Find a description on how to install the CoCoALib on Windows [http://www.apcocoa.org/wiki/HowTo:Compile_CoCoALib_on_Windows here].
 +
**This description is based on CoCoALib 0.99.30.
  
==Cygwin==
+
*Boost Library: You will need this library to enable a few features in the ApCoCoALib. You can [http://www.boostpro.com/download download] precompiled libs for windows. Ensure to install the Libs Date-Time and Thread in order to use the ApCoCoALib for the MatlabToolbox.
To get the latest releases we recommend to use mercurial as your repository client. In case you do not want to contribute to the project the current version can also be downloaded [http://www.apcocoa.org/hg/ here].
 
  
Install Cygwin with the following components activated:
+
*Blas and Lapack Library: You will need those libraries to enable a few features in the ApCoCoALib. The current Repository version of the ApCoCoALib needs you to have one of the following programms installed:
*devel: mercurial
+
** Matlab
*devel: python-brlapi
+
** Intel MKL
*util: patch
 
*editors: nano (or any other editor - optional)
 
  
==MSVC==
+
=Download Instructions=
Version 2003/2005 (for MatlabToolbox MSVC2005 is needed)
+
Get your prefered ApCoCoALib version (stable or developer) from the [[ApCoCoA:SourceCodeManagement|subversion repository]]. General information on the ApCoCoALib source code management can be found [http://www.apcocoa.org/wiki/ApCoCoA:SourceCodeManagement here].
  
==Source code==
+
=Compilation Instructions=
If you downloaded the source code from the repository website you can skip the next section "How to get source code from a repository". In case you use mercurial read the follwoing section.
 
  
Needed are the following repositories:
+
==Config File==
*CoCoALib (e.g. CoCoALib-0.99)
+
Prior to compilation you have to adjust the configuration file. Open the file makefile.vc.conf in the configuration subfolder.
*ApCoCoALib (e.g. ApCoCoALib-devel)
+
Set the pathes accordingly. To use the Intel MKL uncomment line 11 and 14 by removing the # and comment line 09 and 13 by adding a #.
*MatlabToolbox (in case you need the MatlabToolbox-Interface)
+
<pre>#-------------------------------------------------------------------------------
 +
# Adjust the following names and pathes
 +
#-------------------------------------------------------------------------------
 +
_COCOALIB_INCLUDE = ..\..\..\CoCoALib-0.9918\include
 +
_GMP_INCLUDE= C:\Programme\gmp-4.2.2\build.vc8\lib\Win32\Release
 +
_BOOST_INCLUDE= C:\Programme\boost\boost_1_38
 +
# Use the LAPACK/BLAS Libs provided with
 +
#Matlab
 +
_LB_INCLUDE = C:\Programme\MATLAB\R2007b\extern\include
 +
#or Intel MKL
 +
#_LB_INCLUDE = C:\Programme\Intel\MKL\9.0\include
 +
#-------------------------------------------------------------------------------
 +
...
 +
                  -DUSEMatlab -D__MSVC__
 +
#   -DUSEIntelMKL -D__MSVC__
 +
</pre>
  
= How to get the source code from a repository =
+
Note: All pathes shown here are relative pathes to the ApCoCoALib folder.
Open a cygwin command window and create a path you want to store your repositories to. Mercurial is operated by the hg command.
 
  
==Check out: clone==
+
==Compilation==
To create a copy of your repository on your machine use the ''hg clone RepoLink'' command. RepoLink stands for the repository url. You can find the repository url as the link on the [http://www.apcocoa.org/hg/ repositories index site]. E.g. the url to the ApCoCoALib-devel repository is http://www.apcocoa.org/hg/ApCoCoALib-devel/
+
Open a Visual Studio command prompt and change to your local ApCoCoALib folder. Use the nmake command to compile the ApCoCoALib:
 +
<pre>nmake -f Makefile.vc ApCoCoALib</pre>
 +
To show all available targets call
 +
<pre>nmake -f Makefile.vc</pre>
  
This command will create a subfolder on your computer and load all files from the selected repository.
+
==Problems==
 +
If you encounter problems check out the forum: [http://www.apcocoa.org/forum/ ApCoCoA Forum]
  
This command needs to be run only once. To update the repository the command ''hg.pull'' is used.
+
[[Category:HowTo Old]]
 
+
[[Category:ApCoCoALib]]
==Update: pull==
 
The clone command also created a subdirectory called .hg which contains all the relevant information for mercurial to update the repository.
 
 
 
Before updating ensure that cygwin's current directory is the repository directory you want to update. The command ''hg pull'' will then update your local repository copy. To view the changes use the command ''hg log'' or for the last changes ''hg log | less''.
 
 
 
==Patches: import==
 
In case you are contributing to the ApCoCoALib you might want to apply patches before they have been pushed to the repository for download. To apply a mercurial patch use the command ''hg import name.patch'' where ''name'' stands for the filename of the patch. Note that it is assumed that you copied the patch into your local repository folder. Otherwise ''name'' needs to be the path to your patch-file location.
 
 
 
==Upload: commit==
 
To submit a change in the source code two steps have to be taken: committing the change and export as patch. Publish the patch in the [http://www.apcocoa.org/forum/viewforum.php?f=20&sid=bb0de8d0796cd48e1ddadf189752035d forum] and ask the admins to push your patch to the repsoitory (for more details see next section: Patches: export).
 
 
 
Before making changes it is highly recommended to create a copy of your repository clone as your working set in which changes are being made. Thus it is easier to keep track of different development trees while having a latest repository clone in your prefered ''hg pull'' folder.
 
 
 
The changes you have made can be shown by using the command ''hg status'' (names the files which have been changed) and the command ''hg diff'' (displays the lines which have been changed).
 
 
 
To make a change use the command ''hg commit''. This will open the editor (e.g. nano) asking for a description. Alternatively use the command ''hg commit -m "Your description"'' Where "Your description" stands for a brief description of the changes being made in this commit.
 
 
 
Again use the command ''hg log | less'' to see the last change. There will also be a changeset number displayed e.g. 121:xxx where xxx stands for a hashcode.
 
 
 
==Patches: export==
 
To export the patch and ask for pushing (by attaching it to your forum request) get the changeset hashcode (''hg log | less''). Then use the command ''hg export xxx > patchname.patch'' where ''xxx'' stands for the hashcode and ''patchname'' for a patchname. Ensure that the patchname contains no blanks and is a short description. See the forum for examples of patch names.
 
 
 
= How to compile =
 
==Setting pathes==
 
==nmake==
 
 
 
[[Category:HowTo]][[Category:ApCoCoALib]]
 

Latest revision as of 09:41, 29 October 2020

This page is outdated, please see ApCoCoALib:CompilationInstructions

Introduction

  • This site is set up to collect all necessary bits and pieces to compile the ApCoCoALib on Windows.
  • This description is made for compiling the ApCoCoALib with MSVC 2003/2005.

Preparation

Before compiling the ApCoCoALib you need to install the following files/libraries:

  • CoCoALib: The ApCoCoALib is based on and extends the functionalities of the CoCoALib. You need to compile the CoCoALib prior to the ApCoCoALib.
    • Find a description on how to install the CoCoALib on Windows here.
    • This description is based on CoCoALib 0.99.30.
  • Boost Library: You will need this library to enable a few features in the ApCoCoALib. You can download precompiled libs for windows. Ensure to install the Libs Date-Time and Thread in order to use the ApCoCoALib for the MatlabToolbox.
  • Blas and Lapack Library: You will need those libraries to enable a few features in the ApCoCoALib. The current Repository version of the ApCoCoALib needs you to have one of the following programms installed:
    • Matlab
    • Intel MKL

Download Instructions

Get your prefered ApCoCoALib version (stable or developer) from the subversion repository. General information on the ApCoCoALib source code management can be found here.

Compilation Instructions

Config File

Prior to compilation you have to adjust the configuration file. Open the file makefile.vc.conf in the configuration subfolder. Set the pathes accordingly. To use the Intel MKL uncomment line 11 and 14 by removing the # and comment line 09 and 13 by adding a #.

#-------------------------------------------------------------------------------
# Adjust the following names and pathes
#-------------------------------------------------------------------------------
_COCOALIB_INCLUDE = ..\..\..\CoCoALib-0.9918\include
_GMP_INCLUDE= C:\Programme\gmp-4.2.2\build.vc8\lib\Win32\Release
_BOOST_INCLUDE= C:\Programme\boost\boost_1_38
# Use the LAPACK/BLAS Libs provided with 
#Matlab
_LB_INCLUDE = C:\Programme\MATLAB\R2007b\extern\include
#or Intel MKL
#_LB_INCLUDE = C:\Programme\Intel\MKL\9.0\include
#-------------------------------------------------------------------------------
...
                  -DUSEMatlab -D__MSVC__
#		  -DUSEIntelMKL -D__MSVC__

Note: All pathes shown here are relative pathes to the ApCoCoALib folder.

Compilation

Open a Visual Studio command prompt and change to your local ApCoCoALib folder. Use the nmake command to compile the ApCoCoALib:

nmake -f Makefile.vc ApCoCoALib

To show all available targets call

nmake -f Makefile.vc

Problems

If you encounter problems check out the forum: ApCoCoA Forum