VisualSFM install mac issue - sift

Installing VisualSFM on mac with the Dan Monaghan installer and halfway through the build I get an error that reads:
libsiftgpu.so failed to build. Halting.
What caused this and how do I fix it?

Googling found many with similar issues, was able to combine pieces from different solutions and get it working.
Why the error occurs:
The program tries to build & install a siftgpu function on line 246 of the vsfm_os_x_installer.sh file.
But that link is dead.
Step 1:
Manually insert a sift_gpu.zip file into your /users/USERNAME/ directory.
Step 2:
After the sift_gpu.zip file is in your users/USERNAME directory, Ninorian changed the following lines (in the vsfm_os_x_installer.sh file) and it worked for me too:
Search for : sed -i '' Replace with: sed -i
Step 3:
The sift_gpu.zip file opens a directory called SiftGPU-master, and we need to change the name to SiftGPU, so add this line above line 262 like this:
(line 261) mv SiftGPU-master SiftGPU
(line 262) cd SiftGPU
Step 4:
I got this far, but kept getting errors that said “file or directory not found”, and this was remedied by changing the file extension on line 356 in the vsfm_os_x_installer.sh file* (hat-tip to this Github build issue support ticket)
From this:
cp ../patches/SparseBundleCPU.patch src/pba/
To this:
cp -R /users/USERNAME/downloads/VisualSFM_OS_X_Installer-master/patches/SparseBundleCPU.patch src/pba
After that, everything finished installing smoothly,
But I couldn't run it yet.
Step 5:
This 5-minute VisualSFM Mac install YouTube tutorial helped.
Here are the steps:
You need to add 2 scripts to your ~/.bash_profile, go into terminal and type: nano ~/.bash_profile and then paste those two scripts at the bottom of that file.
Save and close ~/.bash_profile
Then go into the /users/USERNAME/vsfm/bin folder and copy libpa.so AND libsiftgpu.so and paste them into your /users/USERNAME/ directory.
Create a new folder in /users/vsfm directory called /users/vsfm/sift
Move the SiftGPU folder from your users/USERNAME/ directory into your /users/vsfm/sift directory
From there, go to users/USERNAME/vsfm/bin/ and double-click on VisualSFM, and if all went well the program should start running and open up, ready for use.
This was a pain in the ass to troubleshoot but it's over and done and I hope this helps anybody.

Related

VS Code - open a file using the same window and keeping the workspace

I want a way to open/create files from the terminal - using the same VS Code Window.
If I try to give the following command using the terminal, it'll close the current window and open a new one.
code . nameofthefile.js -r --reuse-window
Then, if I'm running npm start - the previous command will kill it. On top of this - it'll reload my workspace removing all the folders that were in the Explorer on the left bar.
If I use only ..
code . nomeofthefile.js
this will open a new window. That's not what I want as well.
Is it possible to open a new file without closing the current with a terminal command in VS Code?
The VSCode command line (code) is able to open both folders and files depending on the path you provide. If you provide multiple paths, it will open all of them. If a path does not exist, it will create a new file for you at that location.
# open current folder as workspace
code .
# open file.js in the last used workspace
code file.js # or
code -r file.js
# open file.js inside current folder as workspace
code . file.js
Thus, according to the example you provided, you need to run code nameofthefile.js or
code -r nameofthefile.js (they both seem to do the same thing) to not override your current workspace.
Open a folder in current vs code window while you are using the vs code terminal to change the directory:-
code -r .
To open a folder/file from the terminal in the same VSC window, do the following:
If you are in the folder/file directory:
code -r .
If you are NOT in the folder/file directory:
code -r folder/file-name
Replace folder/file-name with the name of your folder or file. If it's a file don't forget to add the extension.

Apache kafka error on windows 10: kafka-topics.bat file gives syntax error

I am starting to learn Kafka. I managed to run zookeeper and kafka successfully. I am using Windows10 and my kafka version is 2_12-2.5.0.
My question is that when I try to create a topic from cmd using the below command:
kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic firstTopic`
I get the error:
The syntax of the command is incorrect.
I know that the command I wrote is correct and the issue is the command inside the .bat file as I changed the command inside the kafka-topics.bat, the error changes. However I could not manage to run it. This is the content of kafka-topics.bat:
"%~dp0kafka-run-class.bat" kafka.admin.TopicCommand %*
I also tried to run kafka-topics.sh file instead of batch, but that gives a different error opening git bash, that is:
Error:Could not find or load main class kafka.admin.topicCommand
I also got rid of the space in "Program Files" while writing the path, so I don't think that is the reason of this error.
I got stuck and its hard to understand these errors as I am new.
Can you please help?
in my case it worked only when I moved Kafka folder to C: partition without any space in path
for example C:\Kafka_sources
and I used the below command to create a topic
kafka-topics.bat --create --topic test --zookeeper localhost:2181 --partitions 1 --replication-factor 1
in my case:
i removed the quotation marks in .properties for directories
use forward slashes in .properties for directories
i removed the dot-version numbers in directory path (don't know if that was deciding)
but start with point and backlashes .\bin\windows\kafka-server-start.bat .\config\server.properties)
d:\ is possible !

Ubuntu command to find file given filename

I'm trying to find a file called mynet1, and I cant located it in my src folder and want to search all the possible files in my system for it. What is a Ubuntu command to find a file given its filename that could be anywhere in my /root and beyond?
To find a file by name, type:
find <path> -name "<query>"
You can learn a lot here: https://www.digitalocean.com/community/tutorials/how-to-use-find-and-locate-to-search-for-files-on-a-linux-vps#finding-by-name
Note that Midnight Commander (mc) can search for file names (and text), run it from the command prompt, navigate to the top directory of interest and press F9 C F.
To install:
sudo aptitude install mc

Ubuntu - "mv" command renames file to empty file name

I have a simple script to move files between directories. Basically, it is:
mv /dir/* /dir/proc/
saved into a shell script "mvproc.sh".
For some reason, when I run the script (sh mvproc.sh) the file indeed gets moved, but it does not retain the filename and instead gets just an empty filename. When I run the same command at the bash prompt, it works fine however.
This script used to work fine on Debian but we had a hard drive failure and I am now migrating everything over to a Ubuntu machine.
Any idea why this is happening? It seems so simple yet I cannot figure it out.
Many thanks.
edit...
I think I found the solution. For some reason it was putting in carriage returns and maybe line breaks or something that I could not see while editing the sh script in either Notepad++ or even gedit. To solve this, when I open the scripts in gedit, I do a Save As, and select Unix/Linux in the drop down menu towards the bottom. This hopefully gets rid of the weird carriage returns even though I could not see them.
Hopefully this helps some poor soul like me in the future pulling their hair out over this!
Thanks!
Try: mv /dir/file /dir/proc/file
You are indeed moving the file, but aren't specifying a destination name. Other usages of mv:
Move and rename: mv /dir/filename /dir/proc/newfilename
Rename: mv /dir/filename /dir/newfilename

Compiling with GCC on windows 7: \mingw32\bin\ld.exe: cannot open output file a.exe

This is what I get when trying to compile a simple hello world program with gcc.
c:\>gcc hello.c
hello.c:9:2: warning: no newline at end of file
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot open output file a.exe
: Permission denied
collect2: ld returned 1 exit status
Does it have something to do with windows 7 administrative privileges?
If the output file is being created but cannot be opened, where is it located?
Sorry if this is too much of a noobie question. I have been using Dev-C++ for compiling my source code till now. I tried googling around the error but all i could find was the file is already open, but there is no mention of such exe in task manager.
Edit: Also the file is located at C:\hello.c
Will i be able to do it if i place it in other drive?
When i place the file at D:\ and try change it to any other drive using cd d:\ doesn't change the drive.
Yes it is a permissions issue, you must not be running the command line window in Admin mode.
Don't work in C:\
Copy the file to a folder under my documents, or a subfolder of C:, or another drive.
Or, run the console in Administrator mode if you really want to work in the root of C:
To switch to D: while in C:, just type D: (you use CD only when already on the correct drive)
The most common case is that your program may still be running in the background, possibly hanged on an endless loop. You can try searching for the process in the process list (press Alt+Ctrl+Del) and killing it.
I found problem was hosting src under google drive;.. jesus super star chuck norris van damm .. 3h trying to figure out this one (vs code + mingw64).
Solution:
Just moved the folder with my cpp source file outside google drive managed folder tree (was on f:\gd) so moved my source into f:\dev.
The g++.exe-command in the build-log in the CodeBlocks-IDE shows the command
with an additional path: C:\MinGW\lib, which is wrong.
If you copy the command to a cmd-window (in the directory of your Project)
without the C:\MinGW\lib the compiler works. When you copy the command as shown in CodeBlocks-Buil-log it fails, with the same message in the cmd-window.
Have a look at the Settings > Compiler > Search Directories > Linker. You've got to delete the
C:\MinGW\lib there, but the bug is, that it is not deleted if you do it once.
You've got to repeat it and then it works.

Resources