The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Compiling 3.2.1 in visual studio 2008

Open discussion regarding features, bugs, issues, vendors, etc.

Compiling 3.2.1 in visual studio 2008

Postby Andy » Fri Sep 25, 2009 12:44 am

I downloaded and unzipped clapack-3.2.1-CMAKE. In that directory I have a Makefile, but I don't see any .sln or .vcproj files or any directions in the readme that help me build 3.2.1 using visual studio 2008. I tried nmake, but recieved the message that it couldn't find make.inc, which indeed doesn't exist. I do have a make.inc.example, but it appears to be for Linux. Any help would be appreciated.

Thanks,
Andy
Andy
 
Posts: 4
Joined: Wed Nov 12, 2008 8:46 pm

Re: Compiling 3.2.1 in visual studio 2008

Postby Julie » Fri Sep 25, 2009 8:43 am

Andy,
You need to download CMAKE from http://www.cmake.org/
And use CMAKE to generate the package you want.
Let me know if you need further help
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Re: Compiling 3.2.1 in visual studio 2008

Postby Andy » Sat Sep 26, 2009 1:16 am

Thanks Julie,
For others that may be interested...
I downloaded cmake, and let it set my environment variable which it asked when installing.
Then from a command prompt in the directory where CLAPACK was unzipped (clapack-3.2.1-CMAKE) I typed:

cmake -G "Visual Studio 9 2008"

The output was:
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/VC98/Bin/CL.EXE
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/VC98/Bin/CL.EXE -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- CTest cannot determine repository type. Please set UPDATE_TYPE to 'cvs' or 'svn'. CTest update will not work.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Andy/CCProjects/CLAPACK/CLAPACK-3.2.1/clapack-3.2.1-CMAKE


Then magically the file CLAPACK.sln was created in the "clapack-3.2.1-CMAKE" directory... nice.

I opened the solution, and just did a build (the active solution was for debug). I saw lots of warnings about conversion between real and doublereal, but it seemed to build. I found blas.lib, libf2c.lib and lapack.lib in some debug subdirectories.

Now I will try to link to the libs and test some of the functions.
Andy
 
Posts: 4
Joined: Wed Nov 12, 2008 8:46 pm

Re: Compiling 3.2.1 in visual studio 2008

Postby Andy » Sat Sep 26, 2009 9:19 pm

One more bit of information when I try to link...
I get an error for these two functions declarations in clapack.h

/* Subroutine */ int dlabad_(doublereal *small, doublereal *large);
/* Subroutine */ int slabad_(real *small, real *large);

The problem in my case is that my project also includes Microsofts RpcNdr.h, in that header small and large are typedef'ed to be char's. So I have to rename these arguments in clapack.h, I just changed them to this:

/* Subroutine */ int dlabad_(doublereal *smallNum, doublereal *largeNum);
/* Subroutine */ int slabad_(real *smallNum, real *largeNum);
Andy
 
Posts: 4
Joined: Wed Nov 12, 2008 8:46 pm

Re: Compiling 3.2.1 in visual studio 2008

Postby cat_red » Wed Jun 30, 2010 5:32 am

I don't have the same problem, but this seemed to be the most relevant post to my problem. I have installed LAPACK following the cmake instructions. I am now attempting to figure out how to use the libraries. I attempted to follow the steps for "Using CLAPACK subroutines in a Visual (Studio) C/C++ Project" at http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html, but when I try to build the project, I get the following error:

Code: Select all
------- Build started: Project: CLAPACK-EXAMPLE, Configuration: Release Win32 ------
Compiling...
CLAPACK-EXAMPLE.c
Linking...
LINK : fatal error LNK1181: cannot open input file 'blas.lib'
Build log was saved at "file://c:\Documents and Settings\Kis\My Documents\Downloads\CLAPACK-EXAMPLE\CLAPACK-EXAMPLE\Release\BuildLog.htm"
CLAPACK-EXAMPLE - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


As far as I can tell, the blas object library is in the path to libraries (using Tools -> Options -> Projects and Solutions -> VC++ Directories), as I added the file cmake seems to have installed it in (Program Files/CLAPACK/lib). I don't usually use Visual Studio (or Windows at all, for that matter), so I'm kind of at a loss. Has anyone had an error like this? Do you know how it might be fixed? If this example is unsuitable for a cmake build, is there any other tutorial which would be more appropriate? I really appreciate your help,

Cat
cat_red
 
Posts: 2
Joined: Wed Jun 30, 2010 5:10 am

Re: Compiling 3.2.1 in visual studio 2008

Postby admin » Mon Jul 12, 2010 2:54 pm

Cat,
You seems to miss step 4: Move the libraries from step 1 in the lib folder.
Just do a copy paste of the libraries in the lib folder of the Example directory.
admin
Site Admin
 
Posts: 616
Joined: Wed Dec 08, 2004 7:07 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 2 guests