Configuring with Sparse Matrix Libraries

View: New views
8 Messages — Rating Filter:   Alert me  

Configuring with Sparse Matrix Libraries

by Joe Koski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

A quick question. This is a question that all Mac users who build
octave-2.9.x will need to address. This specifically relates to building
octave-2.9.7 on a G5 Mac under OS X 10.4.7 with Xcode tools 2.3 and
gfortran.

I have built and installed all the sparse matrix libraries (libumfpack.a,
libcolamd.a, libccolamd.a, libcxsparse.a, and libcholmod.a) into
/usr/local/lib, with the header files in /usr/local/include.

What is the best way to get the configure script to locate the libraries?

Thanks,

Joe



_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Configuring with Sparse Matrix Libraries

by Dmitri A. Sergatskov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/1/06, Joe Koski <jkoski11@...> wrote:

> Hi all,
>
> A quick question. This is a question that all Mac users who build
> octave-2.9.x will need to address. This specifically relates to building
> octave-2.9.7 on a G5 Mac under OS X 10.4.7 with Xcode tools 2.3 and
> gfortran.
>
> I have built and installed all the sparse matrix libraries (libumfpack.a,
> libcolamd.a, libccolamd.a, libcxsparse.a, and libcholmod.a) into
> /usr/local/lib, with the header files in /usr/local/include.
>
> What is the best way to get the configure script to locate the libraries?

I think you need to copy all header files into the place where C compiler
can find them. /usr/local/include is one of them.
Technically it could be any directory, but then you would need to add
"-I/place/with/headers" to CFLAGS .

>
> Thanks,
>
> Joe
>
>

Regards,
Dmitri.
--
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Configuring with Sparse Matrix Libraries

by pkienzle-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Aug 1, 2006, at 6:10 PM, Joe Koski wrote:

> Hi all,
>
> A quick question. This is a question that all Mac users who build
> octave-2.9.x will need to address. This specifically relates to
> building
> octave-2.9.7 on a G5 Mac under OS X 10.4.7 with Xcode tools 2.3 and
> gfortran.
>
> I have built and installed all the sparse matrix libraries
> (libumfpack.a,
> libcolamd.a, libccolamd.a, libcxsparse.a, and libcholmod.a) into
> /usr/local/lib, with the header files in /usr/local/include.

Looking at the manpage for gcc, you should be able to define the
following environment variables:

    export CPATH=/usr/local/include
    export LIBRARY_PATH=/usr/local/lib

or in csh syntax

    setenv CPATH /usr/local/include
    setenv LIBRARY_PATH /usr/local/lib

Then you should be able to run configure without any options.

Alternatively, you can run ./configure as follows:

    ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2
-I/usr/local/include" LDFLAGS="-L/usr/local/lib"


- Paul

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Parent Message unknown Re: Configuring with Sparse Matrix Libraries

by Joe Koski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

on 8/1/06 7:28 PM, Paul Kienzle at pkienzle@... wrote:

>
> On Aug 1, 2006, at 6:10 PM, Joe Koski wrote:
>
>> Hi all,
>>
>> A quick question. This is a question that all Mac users who build
>> octave-2.9.x will need to address. This specifically relates to
>> building
>> octave-2.9.7 on a G5 Mac under OS X 10.4.7 with Xcode tools 2.3 and
>> gfortran.
>>
>> I have built and installed all the sparse matrix libraries
>> (libumfpack.a,
>> libcolamd.a, libccolamd.a, libcxsparse.a, and libcholmod.a) into
>> /usr/local/lib, with the header files in /usr/local/include.
>
> Looking at the manpage for gcc, you should be able to define the
> following environment variables:
>
>     export CPATH=/usr/local/include
>     export LIBRARY_PATH=/usr/local/lib
>
> or in csh syntax
>
>     setenv CPATH /usr/local/include
>     setenv LIBRARY_PATH /usr/local/lib
>
> Then you should be able to run configure without any options.
>
> Alternatively, you can run ./configure as follows:
>
>     ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2
> -I/usr/local/include" LDFLAGS="-L/usr/local/lib"
>
>
> - Paul
>
Paul, Dmitri,

I initially tried Dmitri's solution, but it didn't work, and Paul's export
CPATH doesn't seem to work either. What I think we have is a case of no
"standard" installer for the sparse matrix libraries. For libraries like
ImageMagick, libjpeg, etc., I had gotten lucky in the past because their
build process has a standard "make install" that can be relied upon to put
the libraries into a predetermined location in /usr/local where the octave
configure script can expect them.

On the positive side, I have edited the Ufconfig.in file for the Mac, so
that it works to build all the necessary sparse libraries. Each build just
parks the .a file (e. g. libumfpack.a) in a /Lib directory with each library
(UMFPACK, COLAMD, CCOLAMD, etc.), and puts the .h files in an associated
/Include directory. There is no standard install into /usr/local for the
five (six?) libraries involved.

Here is what the configure shows:

checking for amd_postorder in -lamd... no
checking ufsparse/colamd.h usability... no
checking ufsparse/colamd.h presence... no
checking for ufsparse/colamd.h... no
checking colamd/colamd.h usability... no
checking colamd/colamd.h presence... no
checking for colamd/colamd.h... no
checking colamd.h usability... no
checking colamd.h presence... no
checking for colamd.h... no
checking ufsparse/ccolamd.h usability... no
checking ufsparse/ccolamd.h presence... no
checking for ufsparse/ccolamd.h... no
checking ccolamd/ccolamd.h usability... no
checking ccolamd/ccolamd.h presence... no
checking for ccolamd/ccolamd.h... no
checking ccolamd.h usability... no
checking ccolamd.h presence... no
checking for ccolamd.h... no
checking ufsparse/cs.h usability... no
checking ufsparse/cs.h presence... no
checking for ufsparse/cs.h... no
checking cxsparse/cs.h usability... no
checking cxsparse/cs.h presence... no
checking for cxsparse/cs.h... no
checking cs.h usability... no
checking cs.h presence... no
checking for cs.h... no

The header files mentioned are currently parked on my system in
/usr/local/include without subdirectories. That may be the problem. Also, I
may need libamd.a, because it is mentioned by the configure script early,
but is not listed as missing at the end of the configure process.

What file structure is the octave configure.in expecting? Maybe I can cobble
together a simple installer script that places the libraries and header
files into their proper "standard" locations.

Joe


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Configuring with Sparse Matrix Libraries

by Quentin Spencer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Joe Koski wrote:

>on 8/1/06 7:28 PM, Paul Kienzle at pkienzle@... wrote:
>
>  
>
>>On Aug 1, 2006, at 6:10 PM, Joe Koski wrote:
>>
>>    
>>
>>>Hi all,
>>>
>>>A quick question. This is a question that all Mac users who build
>>>octave-2.9.x will need to address. This specifically relates to
>>>building
>>>octave-2.9.7 on a G5 Mac under OS X 10.4.7 with Xcode tools 2.3 and
>>>gfortran.
>>>
>>>I have built and installed all the sparse matrix libraries
>>>(libumfpack.a,
>>>libcolamd.a, libccolamd.a, libcxsparse.a, and libcholmod.a) into
>>>/usr/local/lib, with the header files in /usr/local/include.
>>>      
>>>
>>Looking at the manpage for gcc, you should be able to define the
>>following environment variables:
>>
>>    export CPATH=/usr/local/include
>>    export LIBRARY_PATH=/usr/local/lib
>>
>>or in csh syntax
>>
>>    setenv CPATH /usr/local/include
>>    setenv LIBRARY_PATH /usr/local/lib
>>
>>Then you should be able to run configure without any options.
>>
>>Alternatively, you can run ./configure as follows:
>>
>>    ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2
>>-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
>>
>>
>>- Paul
>>
>>    
>>
>Paul, Dmitri,
>
>I initially tried Dmitri's solution, but it didn't work, and Paul's export
>CPATH doesn't seem to work either. What I think we have is a case of no
>"standard" installer for the sparse matrix libraries. For libraries like
>ImageMagick, libjpeg, etc., I had gotten lucky in the past because their
>build process has a standard "make install" that can be relied upon to put
>the libraries into a predetermined location in /usr/local where the octave
>configure script can expect them.
>
>On the positive side, I have edited the Ufconfig.in file for the Mac, so
>that it works to build all the necessary sparse libraries. Each build just
>parks the .a file (e. g. libumfpack.a) in a /Lib directory with each library
>(UMFPACK, COLAMD, CCOLAMD, etc.), and puts the .h files in an associated
>/Include directory. There is no standard install into /usr/local for the
>five (six?) libraries involved.
>
>Here is what the configure shows:
>
>checking for amd_postorder in -lamd... no
>checking ufsparse/colamd.h usability... no
>checking ufsparse/colamd.h presence... no
>checking for ufsparse/colamd.h... no
>checking colamd/colamd.h usability... no
>checking colamd/colamd.h presence... no
>checking for colamd/colamd.h... no
>checking colamd.h usability... no
>checking colamd.h presence... no
>checking for colamd.h... no
>checking ufsparse/ccolamd.h usability... no
>checking ufsparse/ccolamd.h presence... no
>checking for ufsparse/ccolamd.h... no
>checking ccolamd/ccolamd.h usability... no
>checking ccolamd/ccolamd.h presence... no
>checking for ccolamd/ccolamd.h... no
>checking ccolamd.h usability... no
>checking ccolamd.h presence... no
>checking for ccolamd.h... no
>checking ufsparse/cs.h usability... no
>checking ufsparse/cs.h presence... no
>checking for ufsparse/cs.h... no
>checking cxsparse/cs.h usability... no
>checking cxsparse/cs.h presence... no
>checking for cxsparse/cs.h... no
>checking cs.h usability... no
>checking cs.h presence... no
>checking for cs.h... no
>
>The header files mentioned are currently parked on my system in
>/usr/local/include without subdirectories. That may be the problem. Also, I
>may need libamd.a, because it is mentioned by the configure script early,
>but is not listed as missing at the end of the configure process.
>
>What file structure is the octave configure.in expecting? Maybe I can cobble
>together a simple installer script that places the libraries and header
>files into their proper "standard" locations.
>
>Joe
>  
>


I thought I'd mention a couple of things. First (sorry if I'm stating
the obvious), looking at config.log can be valuable in this situation
for determining what error exactly is preventing configure from
detecting the libraries. Second, I don't know which version of UFsparse
you're using, but the 2.0 release has a small change in the headers that
wasn't in previous versions. There is now a UFconfig.h file found in the
UFconfig directory of the source tree that is included by all of the
other headers, and they will break if you haven't copied this to your
include file directory.

Quentin

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Configuring with Sparse Matrix Libraries

by Joe Koski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

on 8/2/06 1:17 PM, Quentin Spencer at qspencer@... wrote:

> Joe Koski wrote:
>
>> on 8/1/06 7:28 PM, Paul Kienzle at pkienzle@... wrote:
>>
>>  
>>
>>> On Aug 1, 2006, at 6:10 PM, Joe Koski wrote:
>>>
>>>    
>>>
>>>> Hi all,
>>>>
>>>> A quick question. This is a question that all Mac users who build
>>>> octave-2.9.x will need to address. This specifically relates to
>>>> building
>>>> octave-2.9.7 on a G5 Mac under OS X 10.4.7 with Xcode tools 2.3 and
>>>> gfortran.
>>>>
>>>> I have built and installed all the sparse matrix libraries
>>>> (libumfpack.a,
>>>> libcolamd.a, libccolamd.a, libcxsparse.a, and libcholmod.a) into
>>>> /usr/local/lib, with the header files in /usr/local/include.
>>>>      
>>>>
>>> Looking at the manpage for gcc, you should be able to define the
>>> following environment variables:
>>>
>>>    export CPATH=/usr/local/include
>>>    export LIBRARY_PATH=/usr/local/lib
>>>
>>> or in csh syntax
>>>
>>>    setenv CPATH /usr/local/include
>>>    setenv LIBRARY_PATH /usr/local/lib
>>>
>>> Then you should be able to run configure without any options.
>>>
>>> Alternatively, you can run ./configure as follows:
>>>
>>>    ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2
>>> -I/usr/local/include" LDFLAGS="-L/usr/local/lib"
>>>
>>>
>>> - Paul
>>>
>>>    
>>>
>> Paul, Dmitri,
>>
>> I initially tried Dmitri's solution, but it didn't work, and Paul's export
>> CPATH doesn't seem to work either. What I think we have is a case of no
>> "standard" installer for the sparse matrix libraries. For libraries like
>> ImageMagick, libjpeg, etc., I had gotten lucky in the past because their
>> build process has a standard "make install" that can be relied upon to put
>> the libraries into a predetermined location in /usr/local where the octave
>> configure script can expect them.
>>
>> On the positive side, I have edited the Ufconfig.in file for the Mac, so
>> that it works to build all the necessary sparse libraries. Each build just
>> parks the .a file (e. g. libumfpack.a) in a /Lib directory with each library
>> (UMFPACK, COLAMD, CCOLAMD, etc.), and puts the .h files in an associated
>> /Include directory. There is no standard install into /usr/local for the
>> five (six?) libraries involved.
>>
>> Here is what the configure shows:
>>
>> checking for amd_postorder in -lamd... no
>> checking ufsparse/colamd.h usability... no
>> checking ufsparse/colamd.h presence... no
>> checking for ufsparse/colamd.h... no
>> checking colamd/colamd.h usability... no
>> checking colamd/colamd.h presence... no
>> checking for colamd/colamd.h... no
>> checking colamd.h usability... no
>> checking colamd.h presence... no
>> checking for colamd.h... no
>> checking ufsparse/ccolamd.h usability... no
>> checking ufsparse/ccolamd.h presence... no
>> checking for ufsparse/ccolamd.h... no
>> checking ccolamd/ccolamd.h usability... no
>> checking ccolamd/ccolamd.h presence... no
>> checking for ccolamd/ccolamd.h... no
>> checking ccolamd.h usability... no
>> checking ccolamd.h presence... no
>> checking for ccolamd.h... no
>> checking ufsparse/cs.h usability... no
>> checking ufsparse/cs.h presence... no
>> checking for ufsparse/cs.h... no
>> checking cxsparse/cs.h usability... no
>> checking cxsparse/cs.h presence... no
>> checking for cxsparse/cs.h... no
>> checking cs.h usability... no
>> checking cs.h presence... no
>> checking for cs.h... no
>>
>> The header files mentioned are currently parked on my system in
>> /usr/local/include without subdirectories. That may be the problem. Also, I
>> may need libamd.a, because it is mentioned by the configure script early,
>> but is not listed as missing at the end of the configure process.
>>
>> What file structure is the octave configure.in expecting? Maybe I can cobble
>> together a simple installer script that places the libraries and header
>> files into their proper "standard" locations.
>>
>> Joe
>>  
>>
>
>
> I thought I'd mention a couple of things. First (sorry if I'm stating
> the obvious), looking at config.log can be valuable in this situation
> for determining what error exactly is preventing configure from
> detecting the libraries. Second, I don't know which version of UFsparse
> you're using, but the 2.0 release has a small change in the headers that
> wasn't in previous versions. There is now a UFconfig.h file found in the
> UFconfig directory of the source tree that is included by all of the
> other headers, and they will break if you haven't copied this to your
> include file directory.
>
> Quentin
>
Quentin,

Your comments were again helpful. Thanks. The main problem revealed by
looking at config.log is that the header files "as received" in the library
.tar files, do not have read permissions set for user or group. As a result,
the configure script couldn't see them. After I did a chmod 0644, to
approximate the permissions I saw on other header files in
/usr/local/include, things started to work. I suspect that the library
developer used root privileges while developing the libraries, and never had
to worry.

I also added the Ufconfig.h file to /usr/local/include, as you suggested. I
had to install the METIS library headers into three separate locations
(/usr/local/include, /usr/local/include/ufsparse, and
/usr/local/include/metis), before I got configure to complete without
reporting errors. Again, checking config.log kept flagging the missing
headers. It took several iterations.

Besides adding METIS, I also added the CAMD library to satisfy missing
externals during the build. I now have eight separate, but related sparse
matrix libraries built in one folder. One fear that I have is that the
header files aren't consistent across all libraries. I got the latest
version of each from the appropriate website. Unfortunately, the versions
are not part of the folder names.

I now have a complete, working Mac G5 build of octave-2.9.7 with
octave-forge, but it fails the test_sparse.m routine with a seg fault. My
recommendation to Mac users would be to stay with octave-2.1.73 until the
kinks are worked out of the sparse matrix routines for the Mac.

Joe


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Configuring with Sparse Matrix Libraries

by John W. Eaton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On  1-Aug-2006, Paul Kienzle wrote:

| Alternatively, you can run ./configure as follows:
|
|     ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2
| -I/usr/local/include" LDFLAGS="-L/usr/local/lib"

Unless you need to specify different -I options for the C and C++
compilers, I would recommend using

  configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"


jwe
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave

Re: Configuring with Sparse Matrix Libraries

by Joe Koski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

on 8/21/06 12:39 PM, John W. Eaton at jwe@... wrote:

> On  1-Aug-2006, Paul Kienzle wrote:
>
> | Alternatively, you can run ./configure as follows:
> |
> |     ./configure CFLAGS="-g -O2 -I/usr/local/include" CXXFLAGS="-g -O2
> | -I/usr/local/include" LDFLAGS="-L/usr/local/lib"
>
> Unless you need to specify different -I options for the C and C++
> compilers, I would recommend using
>
>   configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
>
>
> jwe

John,

After I got the header files for the Ufsparse libraries into the the places
that ./configure was searching, I had no more problems configuring, and
didn't need any additional flags. Because there is no "make install" for any
of the libraries as they are downloaded, header location is a
trial-and-error process for those who are building the libraries from
source. It would help if all the necessary header files (including the metis
headers) were in one location, e.g., /usr/local/include/ufsparse. I don't
know what the Linux install looks like.

The things that I now do now to configure on my Mac (OS X 10.4.7) is export
LIBS=-lcamd to link with the CAMD library, and make sure that the GNU
libreadline.a is picked up instead of Apple's misnamed symlink of the same
name.

Joe


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www.cae.wisc.edu/mailman/listinfo/help-octave