make looks for libraries in the wrong directory - g++

I am trying to compile SageMath from source, following the instructions here. I'm under Ubuntu 20.04.
The compilation fails with two errors and the log file says, among a lot of other things (I can post it all if you want, but it's very long):
g++: error: /usr/lib64/libcudart.so: No such file or directory
g++: error: /usr/lib64/libcublas.so: No such file or directory
Indeed there's no such file in there, they are under /usr/lib/x86_64-linux-gnu.
How do I tell make to look in the right directory? Or is there any other way to fix this?

Related

How to make erlang application?

i'm trying to build the example to run an erlang websocket server.
I created all that files and put them into one folder, add the rebar file and ran
./rebar get-deps
inside the folder direction.
But there is no
make
make runconsole
and nothing's happening.
Is there also a possibility to create that websocket server using IntelliJ? I tried to put that 3 .erl files into IntelliJ and want to Build the project but I receive
erlc: 2: Warning: behaviour cowboy_http_handler undefined
The make command reads something called a Makefile, which is a file written in a certain format, which tells the make command what it is supposed to do, e.g. compile some files with the listed names using the listed commands. Because there is no Makefile listed in that tutorial, you should have gotten an error something like this:
No targets specified and no makefile found.
You can contact the author of the tutorial at his github account and ask him where the Makefile is. Actually, the Makefile for the tutorial is here:
https://github.com/marcelog/erws
I created all that files and put them into one folder
The instructions in the Makefile depend on the exact directory structure that the author has here:
https://github.com/marcelog/erws
I tried using rebar3 and changing some stuff in the Makefile, but I still got errors. The problem is that rel directory: I don't know how to create all the stuff in there. You need to use rebar and reltool for that:
https://gist.github.com/FabioBatSilva/f1d1c4ea250302fed8c2
Here is a cowboy websockets example that I came up with last year, see if it helps:
How to Connect Cowboy (Erlang) websocket to webflow.io generated webpage
It uses the Erlang.mk build system as described in the cowboy docs here:
https://ninenines.eu/docs/en/cowboy/2.5/guide/getting_started/

Check if directory has already been processed by cmake

I need to invoke get_directory_properties on a given directory. However the given directory may be a directory that cmake has not processed (yet) in which case aforementioned command returns an error:
CMake Error at CMakeLists.txt:111 (get_directory_property):
get_directory_property DIRECTORY argument provided but requested directory
not found. This could be because the directory argument was invalid or, it
is valid but has not been processed yet.
Therefore my idea is to verify that the given directory was indeed processed by cmake already (and thus I can safely invoke get_directory_properties on it) and if not I want to do something else.
I was however unable to find a way to check for that and I can't seem to find anything on that on the internet so far. Does anyone know how this could be done?

cmake, linux: build directory given as symbolic link does not work: why?

I have setup with build directory set to ./bin within source root.
Everything works until I change ./bin to symbolic link.
Then everything configures correctly but make starts complaining about not found source files:
make[2]: *** No rule to make target '../cpp/foo.cpp', needed by 'CMakeFiles/mylib.dir/cpp/foo.cpp.o'.
Why it happens and what could I do about it?
I had idea to convert this path to absolute (inside makefile) and dump it to console in order to figure-out where it points to but it turned out that this "build.cmake" is recreated automatically at every make invocation :(
Thanks to Tsyvarev I realized that it is unmovable OS constraint with potential workaround using mount bind
I needed to do the same on a Mac (to exclude the build directory from iCloud Drive) and had success with executing the cmake-command from the build directory (not going there via link) and giving the absolute path for the source to cmake.
See also: https://stackoverflow.com/a/24435795/4883924

ROS Kinetic 'catkin_make' Fails because PROJECT_NAME is set to Project

I have been using ROS Kinetic for a while, and today when I went to make a new catkin workspace following the ROS tutorials page (http://wiki.ros.org/catkin/Tutorials/create_a_workspace) I get a CMake Error stating that PROJECT_NAME is set to Project, which is invalid. I have never run into this issue with any of my other work spaces I have created.
I do not want to mess with toplevel.cmake out of fear of screwing up my other work spaces.
Any ideas why this is happening?
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:91 (message):
catkin_package() PROJECT_NAME is set to 'Project', which is not a valid
project name. You must call project() before calling catkin_package().
Thank you.
I was able to reproduce the above error you are getting. For that what I did is opened my CMakeLists.txt and commented the second line which defines the package Name, i.e., project(package_name). After that, I tried to build my package via catkin_make, but got below error(see the error inside yellow box):
Then, I tried to build the same package after uncommenting the above line. This time I was able to build my package(test, in my case) successfully, without any error.
CMakeLists.txt file contains project() as well as catkin_package() and the former function should be called before catkin_package() inside the file. So, project(package_name) is either missing from your CMakeLists.txt file or is commented.
If it is missing, then manually add it. If it is there, but commented then uncomment it.
Read more about the correct format of CMakeLists.txt file from here.
ironically, you'll be running : sudo apt-get install ros-<distro_name>-catkin to reinstall catkin because even if u clear your entire workspace the problem will persist due to some symbolic link or something broken in the package which will always result in the same error, upon reinstalling catkin it worked for me, knowing that I had the exact same issue.
Had to come answer this because I think I did the same thing OP did. Here's what happened: There are supposed to be TWO CMakeLists.txt in your project folder. One lives at ProjectName/src and should be read-only and should actually be a link to your /opt/ros/your-ros-distro/share/catkin/cmake/toplevel.cmake folder.
If you do like I did, and I'm assuming like OP did, and edit that file, and then use your superuser to overwrite that file, then you are (1) breaking all of your catkin projects, because ALL of the catkin projects link to this one file, AND you're misconfiguring this project because the CMakeLists.txt file you're supposed to modify actually exists a folder deeper, at ProjectName/src/ProjectName/. THIS is where you're supposed to put the CMakeLists.txt file that names your project, where your package.xml file is supposed to go, etc.
If you use superuser to force-overwrite the read-only CMakeLists.txt file then you're going to have a bad day. Fortunately you can fix that file by fixing the toplevel.cmake folder, which you can do by reinstalling the catkin package: sudo apt-get install --reinstall ros-indigo-catkin
And, to put this in terms of OP's question specifically - the project() needs to get named at the inner file, the ProjectName/src/ProjectName/CMakeLists.txt, because again the root file is read-only and should never be modified.

Cannot use TSC - Error reading file "anything.ts": File not found

No matter what I do I cannot get the TSC Typescript compiler to find any files. I have tried both the tsc that comes with the Visual Studio Extension and the one that comes from npm. I've tried in the Node.js command line windows shell, and the Git Bash shell. No matter what I do, it just says the file is not found. I've read that the compiler will only work for .ts and .str files, but that does not seem to be the problem.
Here is a quick example of what I'm seeing. I know these files will be empty, but I've tried all of this with files containing code and it doesn't change anything.
C:\>touch test.ts
C:\>ls *.ts
test.ts
C:\>tsc test.ts
Error reading file "test.ts": File not found
C:\>tsc C:\test.ts
Error reading file "C:\test.ts": File not found
C:\>touch test.str
C:\>tsc test.str
Error reading file "test.str": File not found
C:\>tsc ./test.str
Error reading file "./test.str": File not found
C:\>tsc ./test.ts
Error reading file "./test.ts": File not found
C:\>touch test.js.ts
C:\>tsc test.ts
Error reading file "test.ts": File not found
C:\>tsc test.js
Error reading file "test.js": File not found
I'm afraid, that TSC fails that way on empty files.
Looks like a bug in the current compiler [0.8], tsc shouldn't fail on empty files. However
I know these files will be empty, but I've tried all of this with files containing code and it doesn't change anything.
I'm a bit worried about this part. Is that still the case?
That's difficult to debug from afar. The typescript compiler does quite a lot of processing until it resolves a file.
What's the output of running
tsc -debug test.ts
? Also, please make sure that test.ts is non-empty.