[Trilinos-Users] [EXTERNAL] trilinos in MSVC

Mohammad R. Hashemi mrh1390 at gmail.com
Fri May 17 14:22:19 MDT 2013


Dear Brent,
Thank you for the elaboration. I didn't have any success with
CLAPACK_CMAKE so used the f2cblas and f2clapack libraries from the
previous installation of petsc. Interestingly they worked!
So, I made separate VC projects for f2cblas and f2clapack,
successfully compiled them. (The only issue was the missing quadruple
scalar definition in VC++). Now, everything is fine.

Thank you Chetan, your script helped me a lot.
Thank you Ross for your advise.

Yours,
Mohammad

On 5/17/13, Perschbacher, Brent M <bmpersc at sandia.gov> wrote:
> Mohammad,
>   Those missing symbols are from f2c, if you just moved the lapack.lib and
> blas.lib files to your solution directory(is this a VS thing? I've never
> seen it before) then you won't have all the necessary libraries for
> clapack. There should be a libf2c.lib in the clapack directory that you
> need to move to your solution as well. Another alternative to moving the
> libraries though would be to add the specific directories where those
> libraries live in clapack to your Path environment variable. That should
> allow VS to find them correctly. I believe that the reason you had to do
> that is something we've seen before on windows, but don't know how to fix
> since that is the only platform it happens on and it isn't clear why. But
> the necessary information to make find_package(Trilinos) work without
> moving libraries around or adding stuff to your Path just doesn't seem to
> be available through cmake on windows as it gives us just the name of the
> library for blas and lapack on windows and some how magically finds it for
> our normal builds.
>
>
> In reference to the other issue of how to import Trilinos into another
> cmake project, Ross and Chetan have covered pretty much everything you
> need to know it sounds like, but if you are interested there is
> documentation for the system at:
>
> http://trilinos.sandia.gov/Finding_Trilinos.txt
>
> In addition there is an example project that uses it in the
> demos/build_against_trilinos directory that you can look at. It is a
> working program that uses a fair bit of the export system while still
> being pretty simple so it is good example use case. However, I don't
> believe the author ever tried to run it on windows, but I could be
> mistaken.
>
> Brent
>
> On 5/17/13 7:50 AM, "Mohammad R. Hashemi" <mrh1390 at gmail.com> wrote:
>
>>Dear Chetan,
>>
>>I found a way to create the installation dir:
>>"cmake -P cmake_insatall.cmake" (ran as administrator)
>>INSTALL.vcproj didn't work for me!
>>
>>The next step was (as you said) running cmake with the attached
>>"CMakeLists.txt".
>>
>>However, I it requires lapack.lib to complete the compile procedure:
>>Error	47	error LNK1181: cannot open input file 'lapack.lib'
>>
>>So, I copied blas and lapack libraries (built from clapack_CMake with
>>the same configuration) to the solution directory; I'm afraid it has
>>the same problem as before!
>>Please, take a look at the attachment, VS says that lapack.lib couldn't
>>work!
>>
>>I'd appreciate if you could help me.
>>
>>Yours,
>>Mohammad
>>
>>On 5/17/13, Chetan Jhurani <chetan.jhurani at gmail.com> wrote:
>>> Mohammad,
>>>
>>>
>>>
>>> See attached CMakeLists for creating an exe from a main.cpp and
>>>depending on
>>>
>>>
>>> your Trilinos installation.
>>>
>>>
>>>
>>> Example usage: cmake -DTrilinos_PREFIX="C:\install\Trilinos" -G "Visual
>>> Studio 11 Win64" DIR
>>>
>>>
>>>
>>> where DIR is a directory containing the CMakeLists.txt and your
>>>main.cpp.
>>>
>>> This will create Visual Studio 2012 project with x64 option.
>>>
>>>
>>>
>>> Here C:\install\Trilinos should be an installation with include and lib
>>> directories.
>>>
>>>
>>>
>>> Chetan
>>>
>>>
>>>
>>> From: trilinos-users-bounces at software.sandia.gov
>>> [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of
>>>Mohammad
>>> R.
>>> Hashemi
>>> Sent: Thursday, May 16, 2013 8:33 PM
>>> To: Bartlett, Roscoe A.
>>> Cc: trilinos-users at software.sandia.gov
>>> Subject: Re: [Trilinos-Users] [EXTERNAL] trilinos in MSVC
>>>
>>>
>>>
>>> Dear Ross,
>>>
>>> Can you elaborate this?
>>>
>>>
>>>
>>> Mohammad
>>>
>>>
>>>
>>> On Fri, May 17, 2013 at 7:09 AM, Bartlett, Roscoe A.
>>><bartlettra at ornl.gov>
>>> wrote:
>>>
>>> Mohammad,
>>>
>>>
>>>
>>> If you use CMake for your project to generate visual studio project for
>>>you
>>> APP, you should be able to include TrilinosConfig.cmake
>>> (FIND_PACKAGE(Trilinos)) and that should be it.
>>>
>>>
>>>
>>> Brent,
>>>
>>>
>>>
>>> Is that right?
>>>
>>>
>>>
>>> -Ross
>>>
>>>
>>>
>>> From: Mohammad R. Hashemi [mailto:mrh1390 at gmail.com]
>>> Sent: Thursday, May 16, 2013 10:15 PM
>>> To: Perschbacher, Brent M
>>> Cc: Bartlett, Roscoe A.; trilinos-users at software.sandia.gov
>>>
>>>
>>> Subject: Re: [Trilinos-Users] [EXTERNAL] trilinos in MSVC
>>>
>>>
>>>
>>> Brent,
>>>
>>> Thank you for your explanation. As you said, I just
>>>
>>>
>>>
>>> 1- ran CMake over "clapack-3.2.1-CMAKE" (without even changing its
>>>name!)
>>> and let it make a solution in
>>> "clapack-3.2.1-CMAKE/solution";
>>>
>>>
>>>
>>> 2- installed MPICH with its default windows binary;
>>>
>>>
>>>
>>> 3- ran CMake to create "trilinos-11.2.3-Source/solution", just enabling
>>> Belos/Examples/MPI and of course let the LAPACK_DIR to
>>> remain "clapack-3.2.1-CMAKE/solution".
>>>
>>>
>>>
>>> At last, VS tells that:
>>>
>>>  "========== Build: 51 succeeded, 0 failed, 0 up-to-date, 19 skipped
>>> =========="
>>>
>>>
>>>
>>> Now, my question is how to link trilinos to a VC++ project, is it
>>>sufficient
>>> to (just as any other static library) link the .lib
>>> files and add trilinos include directories? Is there any way to create
>>> dependent VC projects (one is my own c++ project and others
>>> are those currently available in Trilinos.sln)?
>>>
>>>
>>>
>>> On Fri, May 17, 2013 at 3:16 AM, Perschbacher, Brent M
>>><bmpersc at sandia.gov>
>>> wrote:
>>>
>>> Mohammad,
>>>
>>>   I think that the file Ross is refering to is actually in: <trilinos
>>>base
>>> dir>/cmake/tribits/doc/README.windows. However, it seems
>>> like you've done pretty much everything you should, with one exception.
>>>You
>>> should not have moved the *.lib files from where they
>>> were. The cmake build of clapack defines all the necessary information
>>>for
>>> Trilinos to find the blas and lapack libraries where they
>>> were built. It should be sufficient to just build clapack and then try
>>>to
>>> configure Trilinos using the CLAPACK_DIR variable to tell
>>> Trilinos where your copy of clapack is. No need to move any libraries to
>>> some place easier to find. At this point it might be
>>> necessary to delete your CMakeCache.txt for Trilinos though as once
>>>cmake
>>> has decided it hasn't found something it remembers that
>>> and doesn't check again.
>>>
>>>
>>>
>>> Brent
>>>
>>>
>>>
>>> From: <Bartlett>, "Roscoe A." <bartlettra at ornl.gov>
>>> Date: Thursday, May 16, 2013 10:36 AM
>>> To: "'Mohammad R. Hashemi'" <mrh1390 at gmail.com>, "Perschbacher, Brent M"
>>> <bmpersc at sandia.gov>
>>> Cc: "'trilinos-users at software.sandia.gov'"
>>> <trilinos-users at software.sandia.gov>
>>> Subject: RE: [Trilinos-Users] [EXTERNAL] trilinos in MSVC
>>>
>>>
>>>
>>> See the readme file in trilinos base dir. I think it has 'windows ' in
>>>the
>>> name.
>>>
>>> -Ross
>>>
>>> Sent from my android phone. Excuse the terse message.
>>>
>>>
>>> -----Original Message-----
>>> From: Mohammad R. Hashemi [mrh1390 at gmail.com]
>>> Sent: Thursday, May 16, 2013 11:55 AM Eastern Standard Time
>>> To: Perschbacher, Brent M
>>> Cc: trilinos-users at software.sandia.gov
>>> Subject: Re: [Trilinos-Users] [EXTERNAL] trilinos in MSVC
>>>
>>> Hi Brent,
>>>
>>> I generated VS solution in clapack/bin via CMade-GUI and just opened
>>> the solution, let it built (release_x64). Then copied the .lib
>>> (blas.lib and lapack.lib) to the root and have BLAS_LIBRARY_DIRS and
>>> LAPACK_LIBRARY_DIRS point to the root.
>>>
>>> What is the best way to have clapack installed in windows?
>>>
>>> Mohammad
>>>
>>> On 5/16/13, Perschbacher, Brent M <bmpersc at sandia.gov> wrote:
>>>> Mohommad,
>>>>  Can you tell me what you set BLAS_LIBRARY_DIRS and LAPACK_LIBRARY_DIRS
>>>> to
>>>> exactly? On windows we actually search for clapack specifically and in
>>>>a
>>>> different way than we search for most TPLs that makes most of the
>>>> variables
>>>> that are intended to help our configure find a TPL not useful. The best
>>>> way
>>>> to allow the Trilinos configure to find clapack is generally to set
>>>> CLAPACK_DIR to where you have installed clapack. That should allow the
>>>> configure to correctly find your blas and lapack.
>>>>
>>>> Brent
>>>>
>>>> From: "Mohammad R. Hashemi"
>>>><mrh1390 at gmail.com<mailto:mrh1390 at gmail.com>>
>>>> Date: Thursday, May 16, 2013 2:57 AM
>>>> To:
>>>>
>>>>"trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandi
>>>>a.gov>"
>>>>
>>>><trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandi
>>>>a.gov>>
>>>> Subject: [EXTERNAL] [Trilinos-Users] trilinos in MSVC
>>>>
>>>> Dear Trilinos developers,
>>>>
>>>> Using the VC++ 11.0 (2012) x64 compiler, I successfully
>>>> installed/built CMake/CLAPACK. Then introduced the ".lib" blas and
>>>> lapack files to trilinos cmake config via "BLAS_LIBRARY_DIRS" and
>>>> "LAPACK_LIBRARY_DIRS" keywords.
>>>>
>>>> The next step was in visual studio, where the build process succeeded
>>>> for 47 and failed for 43 projects. Noted that I only activate the
>>>> belos package.
>>>>
>>>> As far as I read the errors they are related to BLAS/LAPACK (eg.
>>>> Epetra_BLAS.obj).
>>>>
>>>> I'd appreciate if you could help me.
>>>>
>>>> Regards,
>>>> Mohammad R. Hashemi
>>>>
>>> _______________________________________________
>>> Trilinos-Users mailing list
>>> Trilinos-Users at software.sandia.gov
>>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>


More information about the Trilinos-Users mailing list