GithubHelp home page GithubHelp logo

rmjarvis / tmv Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 19.7 MB

A fast, intuitive linear algebra library for C++. Caveat: This project is no longer being actively developed. I'll still try to respond to bug reports, but that's about it. An alternative that has now become at least as good as (and sometimes better than) TMV for almost all use cases is Eigen. You would probably be well served to switch to that.

Home Page: http://eigen.tuxfamily.org/index.php?title=Main_Page

License: Other

Makefile 0.01% Python 1.10% Shell 0.04% C 3.60% C++ 95.24% Perl 0.01%
c-plus-plus linearalgebra blas lapack matrix vector

tmv's Introduction

See doc/TMV_Documentation.pdf for more complete documention.

This project is hosted at:
https://github.com/rmjarvis/tmv

Installation instructions may be found in the above 
documention or also in the file INSTALL.

There are some example programs in the examples directory.
To make these, type scons examples.

tmv's People

Contributors

rmjarvis avatar timj avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tmv's Issues

No automatic conversion from VarConjIter to VIt

What code snippet produces an error?  (If possible, please also attach
source code of a complete program that will reproduce the error.)  If the
error is in one of the tmvtest programs, just put the error given by the
program.



What is the expected output? What do you see instead?  Or if this is an
error at compilation, what is the compiler error?



What version of the product are you using? On what operating system?  With
what compiler?

Original issue reported on code.google.com by [email protected] on 1 Mar 2013 at 3:38

FINAL_PREFIX sets wrong -install_name

Using fink's package of tmv-0.71 (fink package tmv0-0.71-10) on OS X 10.8 
creates the shared libraries with incorrect install_name data. The installation 
stage of build process is:

scons install PREFIX=/sw/build.build/root-tmv0-0.71-10/sw FINAL_PREFIX=/sw 
IMPORT_PREFIX=false -j1

and the key section of its output is:

g++ -o lib/libtmv_symband.0.dylib -dynamiclib -dynamic 
-Wl,-install_name,/sw/lib/libtmv_symband.0.dylib 
-Wl,-compatibility_version,0.70 -Wl,-current_version,0.71 [lots of src/*.os 
files] -Llib lib/libtmv.0.dylib -lblas
Install file: "lib/libtmv_symband.0.dylib" as 
"/sw/build.build/root-tmv0-0.71-10/sw/lib/libtmv_symband.0.dylib"

That's correct for the file location in the staging directory 
(/sw/build.build/root-tmv0-0.71-10). But the file that gets installed thinks 
that /sw/build.build/root-tmv0-0.71-10/sw/lib/libtmv_symband.0.dylib is its 
actual *runtime* location as well ('otool -L' lists that staging location from 
FINAL_PREFIX rather than PREFIX).

Original issue reported on code.google.com by [email protected] on 11 Aug 2013 at 10:07

Problems with Matrix<int>

User Ronny on tmv-discuss reported the following problem:

Simple program with Matrix<int> determinant produces compiler errors.

#include <TMV.h> 
#include <iostream> 
int main() 
{ 
        int mV[9] = {1,2,3,0,4,5,0,0,6}; 
        tmv::Matrix<int> M(3,3, mV); 
        std::cout << "Determinante:" << Det(M); 
} 

Compiled with: 

g++ -o main.o -c -fno-strict-aliasing -DNDEBUG -I/usr/local/include main.cpp 

g++ -o main -fopenmp main.o -L/usr/local/lib -ltmv -llapack -lblas -lpthread

First produced the linking error:

ld: duplicate symbol bool tmv::TMV_Underflow<int>(int) in 
/usr/local/lib/libtmv.a(TMV_BaseMatrix.o) and 
/usr/local/lib/libtmv.a(TMV_Matrix.o)
collect2: ld returned 1 exit status

When this bug is fixed (adding inline to TMV_Underflow<int> function in 
TMV_Base.h) a lot more linking problems show up.  Starting with:


Undefined symbols:
  "void tmv::RCCMultMM<true, std::complex<double>, std::complex<double>, double>(std::complex<double>, tmv::GenMatrix<std::complex<double> > const&, tmv::GenMatrix<double> const&, tmv::MatrixView<std::complex<double>, (tmv::IndexStyle)0> const&)", referenced from:
      void tmv::BlockMultMM<true, std::complex<double>, std::complex<double>, double>(std::complex<double>, tmv::GenMatrix<std::complex<double> > const&, tmv::GenMatrix<double> const&, tmv::MatrixView<std::complex<double>, (tmv::IndexStyle)0> const&) in libtmv.a(TMV_MultMM_Block.o)
  "void tmv::RCCMultMM<true, std::complex<float>, std::complex<float>, float>(std::complex<float>, tmv::GenMatrix<std::complex<float> > const&, tmv::GenMatrix<float> const&, tmv::MatrixView<std::complex<float>, (tmv::IndexStyle)0> const&)", referenced from:
      void tmv::BlockMultMM<true, std::complex<float>, std::complex<float>, float>(std::complex<float>, tmv::GenMatrix<std::complex<float> > const&, tmv::GenMatrix<float> const&, tmv::MatrixView<std::complex<float>, (tmv::IndexStyle)0> const&) in libtmv.a(TMV_MultMM_Block.o)

....


Using g++ 4.4.2 on Snow Leopard 10.6.4.

Original issue reported on code.google.com by [email protected] on 22 Jul 2010 at 11:02

Build issue with 0.71 on x86_64 bit linux gcc 4.5.0

What code snippet produces an error?  (If possible, please also attach
source code of a complete program that will reproduce the error.)  If the
error is in one of the tmvtest programs, just put the error given by the
program.

Here's the command line scons command I'm using, which correctly links to the 
MKL BLAS and LAPACK I'm using but gives a compilation error that *seems* to be 
regarding code within gcc itself:

lucius% scons PREFIX=/home/browe/local/64 
EXTRA_INCLUDE_PATH=/usr/local/intel/Compiler/11.1/072/mkl/include 
EXTRA_LIB_PATH=/usr/local/intel/Compiler/11.1/072/mkl/lib/em64t 
N_BUILD_THREADS=1 WITH_BLAS=True WITH_LAPACK=True DEBUG=True



What is the expected output? What do you see instead?  Or if this is an
error at compilation, what is the compiler error?

Well, I guess the expected output would be a successful install, I've built 
TMV0.71 in a number of other places without issues.

Here's the scons output:

scons: Reading SConscript files ...
Using compiler: /usr/local/bin/g++
compiler version: 4.5.0
Checking for MKL... yes
Using MKL BLAS
Checking for MKL LAPACK... yes
Using MKL LAPACK
Using OpenMP
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src/TMV_Vector.os -c -O2 -fno-strict-aliasing -fPIC -DMKL -Iinclude 
-I/home/browe/local/64/include -I/usr/local/intel/Compiler/11.1/072/mkl/include 
src/TMV_Vector.cpp
In file included from 
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/
bits/localefwd.h:42:0,
                 from /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/ios:42,
                 from /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/istream:40,
                 from /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/sstream:39,
                 from /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/complex:47,
                 from src/TMV_Blas.h:174,
                 from src/TMV_Vector.cpp:31:
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/
x86_64-unknown-linux-gnu/bits/c++locale.h:52:23: error: 'uselocale' was not 
declared in this scope
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/
x86_64-unknown-linux-gnu/bits/c++locale.h:52:45: error: invalid type in 
declaration before ';' token
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/
x86_64-unknown-linux-gnu/bits/c++locale.h: In function 'int 
std::__convert_from_v(__locale_struct* const&, char*, int, const char*, ...)':
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/
x86_64-unknown-linux-gnu/bits/c++locale.h:72:53: error: 
'__gnu_cxx::__uselocale' cannot be used as a function
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../include/c++/4.5.0/
x86_64-unknown-linux-gnu/bits/c++locale.h:97:33: error: 
'__gnu_cxx::__uselocale' cannot be used as a function
scons: *** [src/TMV_Vector.os] Error 1
scons: building terminated because of errors.

I'm not sure I like the look of "x86_64-unknown-linux-gnu" either, but I'd need 
to contact the sysadmin for clarification on that.


What version of the product are you using? On what operating system?  With
what compiler?

TMV version: 0.71

Operating system: Red Hat Enterprise Linux Workstation release 6.2 (Santiago)

This is relatively new, 12 core system. uname -a gives the following:

$ uname -a
Linux lucius 2.6.32-220.4.2.el6.x86_64 #1 SMP Mon Feb 6 16:39:28 EST 2012 
x86_64 x86_64 x86_64 GNU/Linux


Compiler: gcc 4.5.0

Original issue reported on code.google.com by [email protected] on 3 Aug 2012 at 12:49

Tests fail with TMV Error: Error in test: BandMatrix I/O check normal

I'm installing tmv-cpp 0.71 on OSX 10.8.5 with clang++ 425.0.28 (Xcode 4.6.3). 
The build goes well and I can also build the tests. But running the tests, 
systematically fails with a message of the form

  TMV Error: Error in test: BandMatrix I/O check normal

What comes before that in the tests appears to be executing correctly.

Thanks.

Original issue reported on code.google.com by [email protected] on 9 Mar 2014 at 9:53

SCons fails when PREFIX is same as location of the source code

When running 

scons PREFIX=/location/of/tmv/source/code install

it returns an error:

scons: *** Two different builders (SharedLibrary and InstallBuilder) were 
specified for the same target

The solution is to not do this.  The installation prefix should be some other 
directory.  Not the same location as the source.  But I should have SCons check 
for this and give an appropriate error message about what the problem is.

Thanks to Claudio Bruderer for the reporting this bug. 

Original issue reported on code.google.com by [email protected] on 30 May 2014 at 6:24

Error building with g++-6 and OpenMP

OSX 10.9. I'm trying to update the Homebrew formula for tmv. All is well with clang++, but g++-6 produces the error:

In file included from tests/TMV_TestVector.cpp:2:0:
tests/TMV_TestVector.cpp: In function 'void TestVectorIO()':
tests/TMV_Test.h:75:21: error: cannot convert 'std::ofstream {aka std::basic_ofstream<char>}' to 'bool' for argument '1' to 'void DoAssert(bool, std::__cxx11::string)'
         DoAssert(x,s); \
                     ^

Official download link for v0.72

Would it be possible to have an official-looking download URL for v0.72 (the 
best would be a link pointing to the Downloads section of this site, as it was 
for v0.71). This is for inclusion in the Homebrew formula and we'd rather not 
point users to a Google Drive address.

Thanks!

Original issue reported on code.google.com by [email protected] on 25 Mar 2014 at 8:41

SmallVector has extra 16 bytes of memory usage.

Gary Bernstein pointed out that SmallVector<double> takes 8*N + 16 bytes of 
storage, rather than the expected 8*N.  SmallMatrix<double>, on the contrary 
does take 8*M*N bytes.

The reason is that SmallVector erroneously has a virtual destructor, which it 
should not.  The 16 bytes are the extra storage for the (useless) vtable.

If the extra 16 bytes matter to you, you can remove the virtual specification 
from the SmallVector destructor.  Line 188 in TMV_SmallVector.h.  Otherwise, 
this will be fixed in the next release (0.73).

Original issue reported on code.google.com by [email protected] on 18 Apr 2014 at 2:23

scons install fails on linux when building lib_full_name

Redhat linux with static BLAS will give this:

$ scons install
scons: Reading SConscript files ...
Using the default scons options
Using compiler: /usr/bin/g++
compiler version: 4.8.5
Determined that there are 8 cpus, but only using 4 jobs to avoid overly high memory use.
You can override this behavior with scons -jN
Debugging turned off
Checking for MKL... no
Checking for ACML... no
Checking for GotoBLAS... no
Checking for CBLAS... no
Checking for ATLAS... no
Checking for Fortran BLAS... yes
Using Fortran BLAS
Using OpenMP
TMV Version  $HeadURL$

TypeError: not enough arguments for format string:
  File "/n/home00/melchior.12/code/tmo/tmv-0.72/SConstruct", line 1431:
    SConscript(script_files, exports=['env'])
  File "/n/home00/melchior.12/lib/scons-2.4.1/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "/n/home00/melchior.12/lib/scons-2.4.1/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/n/home00/melchior.12/lib/scons-2.4.1/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/n/home00/melchior.12/code/tmo/tmv-0.72/src/SConscript", line 134:
    lib_full_name = os.path.join(GetBuildPath('#lib'),'libtmv.so.%s.%s'%version)

The failure is clear: in line 134, the string has two %s but only one variable to feed them. I fixed it by replacing it with

    lib_full_name = os.path.join(GetBuildPath('#lib'),'libtmv.so.%s.%s' % (version,0))

The same happens in line 141, i.e. whenever _full_name is being built. With this "fix", the installation runs fine.

Build error with MEM_TEST=true

On OSX 10.8.5 with Xcode 4.3 and clang++ 425, I now deactivate the long double 
tests (following issue #8), but if I enable MEM_TEST=true, I get the following 
compilation error:

/usr/local/opt/scons/bin/scons CXX=/usr/bin/clang++ 
PREFIX=/usr/local/Cellar/tmv-cpp/0.71 INST_FLOAT=true INST_DOUBLE=true 
INST_INT=true SHARED=true TEST_FLOAT=true TEST_DOUBLE=true TEST_INT=true 
MEM_TEST=true WITH_BLAS=true WITH_LAPACK=true WITH_OPENMP=false
scons: Reading SConscript files ...
Using compiler: /usr/bin/clang++
compiler version: 4.2
Determined that a good number of jobs = 8
Debugging turned off
Checking for MKL... no
Checking for ACML... no
Checking for GotoBLAS... no
Checking for CBLAS... no
Checking for ATLAS... no
Checking for Fortran BLAS... yes
Using Fortran BLAS
Checking for Fortran LAPACK... yes
Using Fortran LAPACK
Using mmgr.cpp
scons: done reading SConscript files.
scons: Building targets ...
/usr/bin/clang++ -o src/TMV_Vector.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_Vector.cpp
/usr/bin/clang++ -o src/TMV_MultVV.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultVV.cpp
/usr/bin/clang++ -o src/TMV_AddVV.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_AddVV.cpp
/usr/bin/clang++ -o src/TMV_MultXV.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultXV.cpp
/usr/bin/clang++ -o src/TMV_BaseMatrix.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_BaseMatrix.cpp
/usr/bin/clang++ -o src/TMV_Matrix.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_Matrix.cpp
/usr/bin/clang++ -o src/TMV_MultXM.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultXM.cpp
/usr/bin/clang++ -o src/TMV_AddMM.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_AddMM.cpp
/usr/bin/clang++ -o src/TMV_MultMV.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultMV.cpp
/usr/bin/clang++ -o src/TMV_Rank1_VVM.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_Rank1_VVM.cpp
src/TMV_MultMV.cpp:264:58: warning: for loop has empty body [-Wempty-body]
        for(const Tx* x1=x.cptr(); *x1==Tx(0); ++j1,++x1);
                                                         ^
src/TMV_MultMV.cpp:264:58: note: put the semicolon on a separate line to 
silence this warning
/usr/bin/clang++ -o src/TMV_MultMM_CCC.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultMM_CCC.cpp
/usr/bin/clang++ -o src/TMV_MultMM_CRC.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultMM_CRC.cpp
/usr/bin/clang++ -o src/TMV_MultMM_RCC.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultMM_RCC.cpp
/usr/bin/clang++ -o src/TMV_MultMM_Block.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultMM_Block.cpp
/usr/bin/clang++ -o src/TMV_IntegerDet.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_IntegerDet.cpp
/usr/bin/clang++ -o src/TMV_DiagMatrix.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_DiagMatrix.cpp
/usr/bin/clang++ -o src/TMV_MultDV.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultDV.cpp
/usr/bin/clang++ -o src/TMV_AddDM.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_AddDM.cpp
/usr/bin/clang++ -o src/TMV_MultDM.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultDM.cpp
/usr/bin/clang++ -o src/TMV_TriMatrix.os -c -O2 -fPIC -DTMV_NDEBUG 
-DTMV_MEM_TEST -DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_TriMatrix.cpp
/usr/bin/clang++ -o src/TMV_TriDiv.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_TriDiv.cpp
/usr/bin/clang++ -o src/TMV_MultUV.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultUV.cpp
/usr/bin/clang++ -o src/TMV_MultXU.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultXU.cpp
/usr/bin/clang++ -o src/TMV_AddUU.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_AddUU.cpp
1 warning generated.
/usr/bin/clang++ -o src/TMV_MultUM.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultUM.cpp
/usr/bin/clang++ -o src/TMV_MultUL.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultUL.cpp
/usr/bin/clang++ -o src/TMV_MultUU.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultUU.cpp
/usr/bin/clang++ -o src/TMV_MultDU.os -c -O2 -fPIC -DTMV_NDEBUG -DTMV_MEM_TEST 
-DFBLAS -DFLAPACK -DINST_INT -Iinclude src/TMV_MultDU.cpp
scons: *** [src/mmgr.os] Explicit dependency `src/mmgr.inst' not found, needed 
by target `src/mmgr.os'.
scons: building terminated because of errors.

Maybe not a huge deal, but I'd like tests to pass if this is to be included in 
Homebrew.

Thanks!

Original issue reported on code.google.com by [email protected] on 15 Mar 2014 at 2:51

SConstruct script does not test for USE_UNKNOWN_VARS

What code snippet produces an error?  (If possible, please also attach
source code of a complete program that will reproduce the error.)  If the
error is in one of the tmvtest programs, just put the error given by the
program.

When installing in a customized SCons environment, I get a warning to the 
effect of:

"I do not know what variable ['cc'] is; disable this check with 
USE_UNKNOWN_VARS = true"

However, setting USE_UNKNOWN_VARS = true does not solve the problem

This is because line 1389 of SConstruct does not actually test for 
USE_UNKNOWN_VARS


What version of the product are you using? On what operating system?  With
what compiler?

0.7.2 with clang++ on Max OS X 10.10

Original issue reported on code.google.com by [email protected] on 5 Nov 2014 at 11:22

Make TMV relocatable

I've noticed that TMV produces links to absolute paths in the install phase. This means that I can't move the install tree to a different location and expect anything that linked to the symlink to continue to work. I think changing to use relative paths is a simple way to get that functionality. Playing with this a little, I think the following diff is (close to?) an implementation that could work.

diff --git a/src/SConscript b/src/SConscript
index 8b76632..097849f 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -164,9 +164,17 @@ if env['SHARED']:
         #print 'SymLink: source = ',str(source[0])
         #print 'target = ',str(target[0])
         #print 'LibName = ',env['LibName']
-        t = os.path.abspath(str(target[0]))
+        starting_dir = os.getcwd()
+        t = str(target[0])
+        s = str(source[0])
+        prefix = os.path.commonprefix([os.path.dirname(t), os.path.dirname(s)])
+        os.chdir(prefix)
+        if len(prefix) > 1:
+            t = t[len(prefix)+1:]
+            s = s[len(prefix)+1:]
         if os.path.exists(t): os.remove(t)
-        os.symlink(env['LibName'], t)
+        os.symlink(s, t)
+        os.chdir(starting_dir)

If this is acceptable, I can make a PR.

Edit: I believe this same technique is likely to work for making galsim relocatable as well.

MKL uses single-threaded library rather than multi-thread

When compiling with icpc and MKL, the test for the multi-thread MKL library 
incorrectly links iomp5 after pthread.  It needs to be before pthread for it to 
link correctly.  The workaround if this is affecting you is to compile with:

scons LIBS="iomp5 pthread"

which will force them into the correct order in the link command.  This will be 
fixed in the next version.

Original issue reported on code.google.com by [email protected] on 12 Sep 2014 at 7:08

/usr/local/lib/ appears twice in link attempt by ldconfig

What code snippet produces an error?  (If possible, please also attach
source code of a complete program that will reproduce the error.)  If the
error is in one of the tmvtest programs, just put the error given by the
program.

Fresh install of tmv-0.71
$ scons -j 4
# scons install


What is the expected output? What do you see instead?  Or if this is an
error at compilation, what is the compiler error?

# ldconfig
ldconfig: Can't link /usr/local/lib//usr/local/lib/libtmv.so.0 to libtmv.so.0
ldconfig: Can't link /usr/local/lib//usr/local/lib/libtmv_symband.so.0 to 
libtmv_symband.so.0

should have no output


What version of the product are you using? On what operating system?  With
what compiler?

Debian testing (wheezy), tmv-0.71, g++ (Debian 4.7.0-8) 4.7.0, ldconfig (Debian 
EGLIBC 2.13-33) 2.13

Original issue reported on code.google.com by [email protected] on 26 Jun 2012 at 7:44

Move tmv-cpp to github?

Google code is shutting down:
http://google-opensource.blogspot.de/2015/03/farewell-to-google-code.html

Move tmv-cpp to Github?

Original issue reported on code.google.com by [email protected] on 7 Apr 2015 at 7:28

SmallVector implicit copy assignment bug

When compiling code using SmallVector with a C++-11 standard I am getting errors that indicate that the operator= for this class needs a non-const argument. The symptom is a compiler error when trying to build a defaulted copy assignment for a class that contains a SmallVector as a member. Here is some example code that generates the error (different error text for Clang g++ than for Gnu g++):

EDIT: sorry, I inserted the wrong code...

#include "TMV.h"

using namespace std;

typedef tmv::SmallVector<double,3> MVector;

class MM {
public:
  MVector m;
  MM(const MVector& _m=MVector(0.)): m(_m) {}
  MM& operator=(const MM& rhs)  =default;
  //  {m=rhs.m; return *this;}
};

int
main(int argc,
     char *argv[])
{
  MVector mv(1.);
  MM mm1(mv);
  MM mm2;
  mm2=mm1;
}

It looks to me like the solution is to add const to the copy assignment operator in line 200 of TMV_SmallVector.h:

      inline type& operator=(const type& v2) //***GMB CHANGE 1/24/17

That makes the compiler errors go away, but I don't know whether this is non-const for some other good reason and this would break something. If it's ok, can I make this change and re-scons everything?

Compiler flags for newest Intel compiler

When building with Intel icpc version 17.0.4, these warnings are issued:

icpc: command line remark #10148: option '-vec-report0' not supported
icpc: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'

Xcode 5.1 compile errors

I'm unable to compile TMV with the latest version of Xcode (5.1).  Before this 
update, I *was* able to compile TMV, linking against a macports-installed copy 
of ATLAS.  

Here's my tmv_scons.conf file:

CXX = 'clang++'
PREFIX = '/Users/josh/.local/'
EXTRA_LIB_PATH = '/opt/local/lib/'
EXTRA_INCLUDE_PATH = '/opt/local/include/'

I'm also attaching the stdout/stderr console output from running `scons` and 
the config.log file.

Original issue reported on code.google.com by [email protected] on 12 Mar 2014 at 8:23

Attachments:

issue on Mac OSX 10.12

I tried compiling TMV 0.74 now that I've just moved to OSX 10.12 on my Mac. I get the following warning:

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]

This is just a warning, so I was able to compile/install. But should I be concerned about this, and how can I avoid this problem?

Documentation should recommend using includes with angular brackets

#include "TMV_SymBand.h" is only valid for a local install, it should be #include <TMV_SymBand.h>

Your recommendations should apply to people with tmv installed in the standard location.
Compilers complain about the use of quoted include statements pointing to the standard location.

Infinite loop in SVD on some machines

What steps will reproduce the problem?

Matrix<double> with lots of 1.e-100 values (and consequently singular values of 
this order) goes 
into  infinite loop on some machines when doing m.svd().

What is the expected output? What do you see instead?

Successful completion of svd.


Please use labels and text to provide additional information.

Original issue reported on code.google.com by [email protected] on 17 May 2010 at 2:11

Scons install re-compiles everything

I used the following commands from a newly unpacked 0.72 tarfile:

scons CXX=clang++
sudo scons install PREFIX=/usr/local

I was surprised to see that the install command re-compiles everything, 
apparently duplicating most of the work of the first command.  Is this the 
expected behavior?

Original issue reported on code.google.com by [email protected] on 22 Dec 2014 at 7:16

Complaints from gcc 4.9.2

Getting these errors compiling on MacOSX Fink version of gcc 4.9.2:

In file included from /usr/local/tmv/include/TMV.h:40:
In file included from /usr/local/tmv/include/tmv/TMV_Matrix.h:505:
/usr/local/tmv/include/tmv/TMV_Permutation.h:471:28: error: friend declaration
      specifying a default argument must be a definition
        friend inline void QRP_Decompose(
                           ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:476:28: error: friend declaration
      specifying a default argument must be a definition
        friend inline void QRP_Decompose(
                           ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:852:17: error: friend declaration
      specifying a default argument must be the only declaration
    inline void QRP_Decompose(
                ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:471:28: note: previous declaration
      is here
        friend inline void QRP_Decompose(
                           ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:862:17: error: friend declaration
      specifying a default argument must be the only declaration
    inline void QRP_Decompose(
                ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:476:28: note: previous declaration
      is here
        friend inline void QRP_Decompose(
                           ^
In file included from testPixel1.cpp:4:
In file included from ./Moments.h:6:
In file included from ../gbtools/utilities/UseTMV.h:5:
In file included from /usr/local/tmv/include/TMV.h:44:
/usr/local/tmv/include/tmv/TMV_QRPD.h:127:10: error: friend declaration
      specifying a default argument must be the only declaration
    void QRP_Decompose(
         ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:471:28: note: previous declaration
      is here
        friend inline void QRP_Decompose(
                           ^
In file included from testPixel1.cpp:4:
In file included from ./Moments.h:6:
In file included from ../gbtools/utilities/UseTMV.h:5:
In file included from /usr/local/tmv/include/TMV.h:44:
/usr/local/tmv/include/tmv/TMV_QRPD.h:131:10: error: friend declaration
      specifying a default argument must be the only declaration
    void QRP_Decompose(
         ^
/usr/local/tmv/include/tmv/TMV_Permutation.h:476:28: note: previous declaration
      is here
        friend inline void QRP_Decompose(

Original issue reported on code.google.com by [email protected] on 4 May 2015 at 12:24

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.