Having trouble editing and executing .sh file in Cygwin - bash

I am relatively new to the Cygwin program, and I have a .sh file that I need to edit and execute. I am currently running on Windows 10. I have installed Cygwin64 terminal on my machine.
The full list of steps required are as follows:
Be sure to have libtool installed.
Download protobuf from https://github.com/google/protobuf/ (download ZIP and unZIP at desired location, or clone the repo) The protocol buffer is used for communication between the CuraEngine and the GUI.
Before installing protobuf, change autogen.sh : comment line 18 to line 38 using #s. This removes the dependency on gtest-1.7.0.
Run autogen.sh from the protobuf directory: $ ./autogen.sh
$ ./configure
$ make
$ make install # Requires superused priviliges.
(In case the shared library cannot be loaded, you can try "sudo ldconfig" on Linux systems)
Once I get to 3.:
Before installing protobuf, change autogen.sh : comment line 18 to line 38 using #s. This removes the dependency on gtest-1.7.0.
I am having issues opening up to .sh file in Cygwin to make the appropriate edit.
When I try this command to even execute the .sh file:
$ '/cygdrive/c/Users/Thomas/Desktop/3D Printing/protobuf-master/autogen.sh'
I receive the error:
Could not find source code. Make sure you are running this script
from the root of the distribution tree.
If anyone has some insight as to a solution for this problem it would be greatly appreciated.

You are getting the error from this test in autogen.sh :
# Check that we're being run from the right directory.
if test ! -f src/google/protobuf/stubs/common.h; then
cat >&2 << __EOF__
Could not find source code. Make sure you are running this script from the
root of the distribution tree.
__EOF__
In this test, common.h path is relative to the protbuf install directory, just cd to it before executing the script.

Related

config.status: error: cannot find input file: `po/Makefile.in.in'

I hit this error message while trying to build gnote using GNU Autotools.
I had first run:
$ git clean -xf # to clean the tree of untracked files, then
$ autoreconf # to create the script named `configure`, and finally
$ ./configure # to check my system, and create Makefiles from their templates
Neither po/Makefile.in.in nor po/Makefile.in exist in the source tree that I downloaded.
Yet configure needs to make this po/Makefile, as called for in the root Makefile.am in this line:
SUBDIRS = data src po help
Where do I get, or how do I make, po/Makefile.in.in?
Like all Gnome related packages, gnote uses many steps of buildsystem setup beyond just running autoreconf.
The autogen.sh script gnote comes with should run all the required steps to set up the buildsystem.
As usual, run the autogen.sh script with the --help parameter if you want to call configure separately.
po/Makefile.in.in is created by running intltoolize from the intltool package. It needs to be run from the project tree's root directory.
There isn't much documentation on intltoolize that I could find except for the brief man page, but it's source code says that that it's a fork of an older utility called libtoolize, and it's a relatively short script.
(BTW, if you don't already have intltoolize installed, you can figure out which package installs it, with this: sudo apt-file find intltoolize.)
*.in files are templates used by AutoMake to create a Makefile.
.in.in is a soft link to /usr/share/intltool/Makefile.in.in.

Trying to get #include <gmpxx.h> to run in my program

In my code I'm getting a fatal error of :
fatal error: gmpxx.h: No such file or directory|
I'm trying to use the The GNU Multiple Precision Arithmetic Library, but I'm having trouble trying to get the library downloaded an working in the right place.
I download the file gmp=6.1.0.tar.lz but I have no idea how to open it, use it, or even where it needs to be placed.
I'm using Codeblocks, and a Windows 10 computer.
First, install some basic GNU utilities via MinGW. We need tar. Then, download a stable lzip release. Choose tarball not lzip archive, because we want to build lzip. Now, open your MSYS shell, go to directory made after extracting lzip tarball (this directory should be available as /c/<PATH ON C DRIVE WITH BACKSLASHES REPLACED WITH SLASHES>) and run:
./configure --prefix=/
make
make install
Then go up (cd ..) and run:
tar xvf gmp-6.1.0.tar.lz
It should extract this file. Now, build GMP by going to directory gmp-6.1.0 and running:
PATH="/c/Program Files/CodeBlocks/MinGW:$PATH" ./configure --prefix='/c/Program Files/CodeBlocks/MinGW'
on 32-bit system, or:
PATH="/c/Program Files (x86)/CodeBlocks/MinGW:$PATH" ./configure --prefix='/c/Program Files (x86)/CodeBlocks/MinGW' --enable-cxx
on 64-bit. Run these commands:
make
make install
You should have GMP installed.

configure command not found cygwin

This question has been asked many time but I am not able to resolve the problem from them so I am asking
I had installed Cygwin a few days ago.I tried using ./configure command but it says
-bash: ./configure: No such file or directory
I tried using
where configure
but I got the output
INFO: Could not find files for the given pattern(s).
then I tried grep configureand I got this output
/etc/bash_completion.d/configure
/usr/i686-pc-cygwin/sys-root/usr/share/libtool/libltdl/configure
/usr/share/ELFIO/configure
/usr/share/libtool/libltdl/configure
I tried to export the path and then run the ./configure but it also didn't worked.
I find no executable file named as configure in my cygwin bin directory.
Does it mean that I have to add configure file manually?How can I correct it?
NOTE :- I had also tried sh configure but it also didn't worked
If a software project is set up to be built using autoconf, that tool generates a script canonically called configure. It queries the system for various parameters that are subsequently used in the build, and is specific to the software package to be built. Different software projects have different configure scripts. They are all called configure, but their contents are not the same.
So, to actually build such a software project once that script was set up (usually done by the maintainers when packaging the source tarball for distribution), you call:
tar xzf <tarball>.gz # or xjf <tarball>.bz2 or whatever
cd <sourcedir> # the one you just untarred
./configure
make
make install
Note the prefix ./, which means "located in this directory" (i.e. the top directory of that project's source tree).
Actually, the better procedure is the so-called "out-of-tree build", when you set up a different directory for the binaries to be built in, so the source tree remains unmodified:
tar xzf <tarball>.gz # or xjf <tarball>.bz2 or whatever
mkdir builddir
cd builddir
../<sourcedir>/configure
make
make install
So, there is supposed to be no configure executable in your PATH, you are supposed to call the script of that name from the source tree you are trying to build from.
If I correctly understood...
Configure is not an application that should be installed on your system, but script that should be delivered with source code to prepare for make command. File named configure should be in the main directory of source code.
I understand that this is an old question. However many might find this solution helpful.
Normally we use the make command to compile a downloaded source in cygwin. In many cases it contains a autogen.sh file. Running that file with
bash autogen.sh
will in many case solve the problem. At least it solved my issue and i could then use the make command

Installing cgdb on a mac os x

I know that this should probably be very easy, and I have looked into the read me files and other files in cgdb like INSTALL that talk about isntalling cgdb. I was trying to install cgdb and the instructions said:
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
However, there is no such file inside of the file I got from running the git clone command. i.e. from running:
$ git clone git://github.com/cgdb/cgdb.git
I went inside that file to see the installation instructions and it says the following:
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
and there is more I didn't paste.
The part that confuses me is the following paragraph:
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
does it mean I should run ./configure.in? I am honeslty a little scared of running it because I need to run it in as sudo plus, that file doesn't even exit in the code I got from git clone. This is what I do have in that directory:
➜ cgdb git:(master) ls
AUTHORS Makefile.am autogen.sh doc roadmap.txt
COPYING NEWS autorelease.sh indent.sh test
ChangeLog README cgdb lib
FAQ README.md config packages
INSTALL TODO configure.init release-todo.txt
➜ cgdb git:(master)
I did grep for config or config.in in that directory and it didn't yield anything useful.
I have also tried brew installing it but I ran into problems. When I cgdb the file and hit run it frozen at a print statment instead of moving on to the next command prompt for gdb as in (gdb). Anyone knows whats up? Is it because I am using go source file?
What have people done to have cgdb working on a mac?
Неу, yeah, the git source for cgdb doesn't come with the configure script pre-built. (The official release distributions do, however.)
If you have the right tools installed, you can fix this by running:
./autogen.sh
This will generate the configure script, and then you can install it as you would any other autoconf-based source package.
Forget about all that aggro with configuration and dependency libraries; install MacPorts and do:
$ sudo port install cgdb
They have 0.6.7 at the time of writing.
What worked for me was doing:
brew install cgdb
However, for me that was not enough to get it going. I needed to sudo it for it to run:
sudo cgdb
I would have never guessed I needed to sudo it...I figured it out because it was throwing me the error talked about in the following question:
gdb fails with "Unable to find Mach task port for process-id" error

Error when opening .tar.gz via Shell to install Apache Maven

Machine:
Mac OSX 10.5.8 32-bit.
Goal:
To install apache maven per its websites instructions, in order to install the JUNG package according to its install instructions, so I can use the JUNG classes in various Java GUIs.
What I Did:
Downloaded a .tar.gz file, and using the shell, moved it to a directory (using mv) I created for it (using mkdir), usr/local/apache-maven per the website directions
I downloaded the file apache-maven-3.0.4-bin.tar.gz. Next I tried extracting the file using tar -zxvf apache-maven-3.0.4-bin.tar.gz.
Error:
I get an error message when I try to extract the apache-maven .gz (install?) file in shell.
tar: apache-maven-3.0.4/direcoryandfile: Cannot open: No such file or directory
...
apache-maven-3.0.4/lib/ext: Cannot mkdir: No such file or directory apache-maven-3.0.4/lib/ext/README.txt
tar: apache-maven-3.0.4/lib/ext/README.txt: Cannot open: No such file or directory tar:
Error exit delayed from previous errors
Instructions:
For the maven building
Extract the distribution archive, i.e. apache-maven-3.0.4-bin.tar.gz to the directory you wish to install Maven 3.0.4... The subdirectory apache-maven-3.0.4 will be created from the archive.
...
for the JUNG installation
Appendix: How to Build JUNG
Get Maven
Download and install maven2 from maven.apache.org: http://maven.apache.org/download.html. At time of writing (early June 2012), the latest version was maven-3.0.4. Install the downloaded maven2 (there are installation instructions on the Maven website).
Follow the installation instructions and confirm a successful installation by typing 'mvn --version' in a command terminal window.
Self-Rectification Attempts
From what I can tell the archive file is missing some directories or something. I tried deleting the file, redownloading the .tar.gz file from a different mirror and repeating the process. Same result. Thanks again for the help
Background:
I'm trying to install the JUNG package to my system's Java, so I can write object-oriented code using various GUIs (Ecliplse, Dr. Java) using the classes in JUNG. I don't understand how the building/installing process works, and how I can get what I build/install to work on various GUIs and the command line. I'm new to shell and the command line, and mostly have experience using a simple IDE (DrJava, Python IDLE, R GUI) to write and compile object-oriented code.
To unpack a tar.gz archive you need to do it either in two steps:
gunzip apache-maven-3.0.4.tar.gz
tar -xf apache-maven-3.0.4.tar
or you might try to do it in a single step:
tar -zxf apache-maven-3.0.4.tar.gz
Two Step Process:
1. Extract the .tar from the .tar.gz using gunzip, and -v for having gunzip print what its doing. gunzip -v apache-maven-3.0.4.tar.gz
2. Extract the .tar file using tar, -x for telling the program to do an extraction, -v for having tar print what its doing, and -f for tar to know that the following file is the archive and appending with sudo so tar has permission to create directories. sudo tar -xvf apache-maven-3.0.4.tar

Resources