Swift Build no such command - openstack-swift

python-swiftclient 3.0.0
Ubuntu 16.04.1 LTS
I type in swift build and it returns the list of swift commands and says at the end no such command. Could not find anyone describing this specific command line response.

That's because you use either python-swiftclient either your PATH is wrong.
If swift --version returns:
python-swiftclient 3.0.0
Then you aren't currently calling swift build system. Check this link and update your swift release here.
Else check that you call the right swift executable by doing:
which swift
The output is the executable you are actually calling.

Environmental variable failure
just
source ~/.bashrc

Seems that the entire swift environment is needed, so visit the swift download page, and choose your system (mine is ubuntu 18.04):
$ wget https://download.swift.org/swift-5.5.2-release/ubuntu1804/swift-5.5.2-RELEASE/swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
$ tar -xf swift-5.5.2-RELEASE-ubuntu18.04.tar.gz
$ PATH=~/swift-5.5.2-RELEASE-ubuntu18.04/usr/bin:$PATH
This solution worked perfect for me.

Related

Vapor migrate command not found

I installed a swift vapor web-server and I have to run some migrations. Reading from the docs(https://docs.vapor.codes/fluent/migration/?h=migrate#migrate) it says that I just have to run vapor run migrate but all I get is an error that says .unknownCommand("migrate", available: ["boot", "serve", "routes"]). It seems the vapor toolbox doesn't have the migrate command. I installed the vapor toolbox following the docs(https://docs.vapor.codes/install/linux/#install-toolbox):
git clone https://github.com/vapor/toolbox.git
cd toolbox
git checkout <desired version>
make install
To be fair i had some problems with the make install comand. It said that swiftc wasn't a valid comand but I just changed swiftc to swift inside the Makefile and it did compile at the end. As a matter of fact the vapor --version command works.
I use swift 5.5 and vapor 4. Does anybody now how to fix this or find some workaround like running the migration file by itself without the command?
I don't really use the vapor toolbox anymore. I put the second line in main.swift in the Sources/App/Run folder:
// earlier lines omitted
try configure(app)
try app.autoMigrate().wait() // <-- this one needs to be in this position
try app.run()
It needs to be after everything has been configured but before you start the app running.

Swift "Build" not working on Ubuntu 16.04

I have recently installed swift by following the commands described on https://github.com/PerfectlySoft/PerfectDocs/blob/master/guide/gettingStarted.md
Installation seems to be OK.
swift --version is python-swiftclient 3.2.0
but when go swift build it says "no such command: build"
What am I supposed to do?
"python-swiftclient" has nothing to do with Apple's Swift, it's a library for the OpenStack Object Storage API.
To install Apple's Swift on Ubuntu, you need to follow the instructions detailed at swift.org as told on the Perfect document you're referring: "After you have installed a Swift 3.0 toolchain from Swift.org..."
You will have to install dependencies with:
$ sudo apt-get install clang libicu-dev
then extract the .tar.gz file downloaded from swift.org and set the PATH to the executable - all of this is explained on the site.

Error: version `GLIBCXX_3.4.21' not found

I am trying to compile matconvnet-1.0-beta20 with Matlab 2016a on Ubuntu 16.04. Initial phase of compilation works fine:
untar('http://www.vlfeat.org/matconvnet/download/matconvnet-1.0-beta20.tar.gz') ;
cd matconvnet-1.0-beta20
run matlab/vl_compilenn
The error happens when I run vl_simplenn(network, image) which gives following error:
Invalid MEX-file '/home/matconvnet-1.0-beta20/matlab/mex/vl_nnconv.mexa64':
/usr/local/MATLAB/R2016a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version
`GLIBCXX_3.4.21' not found (required by /home/matconvnet-1.0-beta20/matlab/mex/vl_nnconv.mexa64)
To understand the cause of problem, I run /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC which doesn't give any output bash: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: Permission denied
Also more /usr/lib/x86_64-linux-gnu/libstdc++.so.6 gives no output:
******** /usr/lib/x86_64-linux-gnu/libstdc++.so.6: Not a text file ********
I did some research and found some possible solutions:
http://it.mathworks.com/matlabcentral/newsreader/view_thread/162466
The problem is that MATLAB secretly changes LD_LIBRARY_PATH on startup
to point to the MATLAB version of GLIBC++, so that GLIBC++ 3.4.9 can
no longer be found. The solution is to modify matlab/bin/.matlab7rc.sh
so that "LDPATH_PREFIX" contains the path to the version of GLIB
installed with your compiler, then this is found before the
matlab-supplied library.
so I edited /usr/local/MATLAB/R2016a/bin/.matlab7rc.sh and modified LDPATH_PREFIX='' in 195th line to LDPATH_PREFIX='/usr/lib/x86_64-linux-gnu'.
After applying this change, the problem still exist.
As suggested here, I copied .matlab7rc.sh to current working directory of project, but still error persist.
https://askubuntu.com/questions/719028/version-glibcxx-3-4-21-not-found
According to first answer, running this command
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 usr/local/MATLAB/R2014a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6
gives an error:
ln: failed to create symbolic link 'usr/local/MATLAB/R2014a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6': No such file or directory
Seems like second solution suggests changes of LD_PRELOAD path in .matlab7rc.sh, but it is not anywhere inside the file.
How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?
From Matlab directory in /usr/local/MATLAB/R2016a/bin$ I run
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libstdc++.so.6
but the problem still exist.
Maybe there I didn't apply the solution in the correct way Or maybe there is another solution elsewhere that I didn't find. Please let me know, I am very confused!!!
You need before execute (matlab in my case) add path of library:
In console execute this:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 matlab
I had the same problem.
In my case, to solve it, I first ran "locate" to list all the possible versions of the library in the system.
locate libstdc++
As an example, I report the result on my system
I then set the most recent version of "lib" by exporting the environment variable:
export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21"
So, the fullpath of the library to be set depends on where it is allocated in your system.
There are 2 possible solutions:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libstdc++.so.6
Install this package:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
MAYBE the second solution you mentioned really works, but you have done it before. So you cannot operate in the same way again because you have ever linked /usr/lib/x86_64-linux-gnu/libstdc++.so.6 to usr/local/MATLAB/R2014a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6. TRY rebooting?
Also, you use MATLAB R2016a, but this command applies to R2014a. Was it that you ignore this point?

Unable to install Swift in Ubuntu

Hi I am trying to install Swift on Ubuntu (Ubuntu 15.10). I followed the guide of Apple at swift.org. But after executing all the steps when I execute following command
swift --version
It returns error saying
harshit#harshit-Linux:~/swift/usr/bin$ swift --versionThe program 'swift' can be found in the following packages:
* python-swiftclient
* python3-swiftclient
Try: sudo apt-get install <selected package>
I used
export PATH=/home/harshit/swift/usr/bin/swift:"${PATH}"
Here is my directory path
http://pastebin.com/Z1aNiDQM
Kindly help me to complete installation.
You are declaring your path like this:
export PATH=/home/harshit/swift/usr/bin/swift:"${PATH}"
but it's wrong because it includes the swift executable itself in the path.
It should be like this instead:
export PATH=/home/harshit/swift/usr/bin:"${PATH}"
It sounds like you did not add swift to your path. Do you have the direct path to where it is installed? You could try /usr/whereever/bin/swift

libgfortran: version `GFORTRAN_1.4' not found

I am getting the following error when I trying to a run mex file in MATLAB:
??? Invalid MEX-file
'findimps3.mexa64':
/MATLAB/bin/glnxa64/../../sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/libblas.so.3gf)
Any ideas how to solve this problem?
update:
I found out that "strings MATLAB/.../libgfortran.so.3 | grep GFORTRAN" output GFORTRAN_1.0. I tried to changed libgfortran inside MATLAB but it didn't work. Not I think it's better to find a suitable libblas that works with GFORTRAN_1.0.
read this link, it explains how to configure matlab on some linux systems.
here the steps that are relevant to you:
To enable running external programs, […] fortran libraries need to be properly updated and linked. Look at the output of this command:
ll "$MATLABDIR/bin/glnxa64/"
It is likely that [this link] exist:
libgfortran.so.3 -> libgfortran.so.3.0.0
Search for [this library] on your machine:
locate libgfortran.so
[…] Update Matlab's links to point to these newer versions:
sudo ln -sf [location of libgfortran.so.3.0.0] "$MATLABDIR/bin/glnxa64/libgfortran.so.3"
I (think I) fixed this problem by running matlab with LD_PRELOAD, like this
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libfreetype.so:/usr/lib/x86_64-linux-gnu/libgfortran.so.3 matlab
Notice freetype was another library I was having a similar problem with.
In my case the following command worked:
sudo ln -sf /usr/lib/gcc/i686-linux-gnu/4.7/libgfortran.so /usr/local/MATLAB/R2012a/sys/os/glnx86/libgfortran.so.3
Matlab was complaining it couldn't find the GFORTRAN1.4 in the following location:
/usr/lib/gcc/i686-linux-gnu/4.7/libgfortran.so
So I linked this location to the library I had :
/usr/local/MATLAB/R2012a/sys/os/glnx86/libgfortran.so.3
I found the location of this library by using the locate command as given above:) Thanks for the help:)
In my case, fixed by
$ ln -sf /usr/lib64/libgfortran.so.3.0.0 /opt/matlab/sys/os/glnxa64/libgfortran.so.3
Errors I meet when using CDSP:
csdp: /opt/matlab/sys/os/glnxa64/libgfortran.so.3: version GFORTRAN_1.4' not found (required by /usr/lib64/atlas/libptf77blas.so.3)
csdp: /opt/matlab/sys/os/glnxa64/libgfortran.so.3: versionGFORTRAN_1.4' not found (required by /usr/lib64/atlas/libf77blas.so.3)
I just ran into the same problem (error usr/lib64/libgfortran.so.3: version `gfortran_1.4' not found) and it was actually not hard to fix. The problem seems to be that gfortran_1.4 version of libgfortran.so.3 comes from the release gcc-4.6.2 (i.e. fortran 4.6).
What I did was downloaded gcc-4.6.2 and built, using the steps: tar -xvf gcc-4.6.2.tar.gz cd gcc-4.6.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir $PWD/../gcc-4.6.2/configure --prefix=$HOME/gcc-4.6.2 --enable-languages=c,fortran,c++,go make make install
Then, once everything was made, I went to the directory where the new, fresh libgfortran.so.3 was sitting (in my case it was /home/testuser/objdir/x86_64-unknown-linux-gnu/32/libgfortran/.libs/)
I copied this version of libgfortran.so.3, and went to the directory where my program was expecting to find libgfortran.so.3. I replaced the old one (the old libgfortran.so.3) with the new one (the one we just copied).
The problem instantly went away. I hope this helps you too!