getting error: bash: ./autogen.sh: No such file or directory

20,246

The syntax you are using

./name-of-file

runs an executable in the current working directory. If you cannot see name-of-file with ls -a it will fail with the error you saw, and if it does not have execute permission for the user running the command, it will fail with permission denied (if there are no x bits set at all, and you try running it with sudo, the fail message will be command not found)

The program you are trying to compile uses the cmake method to set up the build environment, and there is evidently no autogen.sh (or configure) script to run.

I just successfully built this release from the GitHub page you linked to. It was straightforward, and I didn't encounter any problems.

First you need to install all the dependencies for the build. I'm not sure if all this is actually required, but you mentioned needing some of it anyway...

sudo apt install build-essential automake dh-autoreconf libusb-1.0-0-dev cmake g++

make a directory at the location shown in your screenshot (open a terminal and cd /ARMToolchains/stlink-master if necessary... why aren't you building in your home directory? I recommend moving the whole directory to $USER, but anyway...) the basic method is

mkdir build
cd build
cmake ..

When that exits successfully, you can run

make

If that exists successfully, you may run

sudo make install

To move the binaries to the correct locations. If not, you can run them from the current directory. If you can't get the version you've already downloaded to build (this happens quite often when cloning the master as it might be in the process of getting tweaked), then download one of the releases (like the one I linked above) and try again.

Share:
20,246

Related videos on Youtube

abinjacob
Author by

abinjacob

Updated on September 18, 2022

Comments

  • abinjacob
    abinjacob over 1 year

    Need to install st-linkv2 in eclipse for stm32f4 programming.

    automake, dh-autoreconf, libusb-1.0-0-dev are required for st-linkv2.

    Terminal looks like this:

    abin@abin-Compaq-Presario-C700-Notebook-PC:~/ARMToolchains/stlink-master$ ls -a
    .               debian        LICENSE                 .travis.sh
    ..              doc           Makefile                .travis.yml
    .appveyor.yml   etc           README.md               usr
    build           flashloaders  scripts                 .version
    ChangeLog.md    .github       src
    cmake           .gitignore    stlinkv1_macosx_driver
    CMakeLists.txt  include       tests
    $ ./autogen.sh
    bash: ./autogen.sh: No such file or directory
    $ whereis automake
    automake: /usr/share/man/man1/automake.1.gz
    $ ./configure
    bash: ./configure: No such file or directory
    $ sudo apt-get install automake
    [sudo] password for abin: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    automake is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
    $ whereis autoconf
    autoconf: /usr/bin/autoconf /usr/share/autoconf /usr/share/man/man1/autoconf.1.gz
    $ whereis libusb-1.0-0-dev
    libusb-1: /usr/include/libusb-1.0
    

    I have downloaded the source from here on GitHub.

    I've been blindly following this You Tube video which shows how to use Eclipse in Linux for STMboard programming and dumping the code into the board. The maker of the video performs the operation I'm trying to do at 8:37.

    OS is Ubuntu 15.04, 32-bit.

    I would like to know how to compile this. I also want to understand why we use methods like ./autogen.sh and other commands.

    • steeldriver
      steeldriver about 7 years
      Why do you think you should be running ./autogen.sh? based on the directory contents in your screenshot, the software's build system appears to be cmake rather than GNU autotools.
    • Chai T. Rex
      Chai T. Rex about 7 years
      Please don't use screenshots for text. Instead, copy and paste the text into your question, select the text, and press the {} button in the editor.
    • abinjacob
      abinjacob about 7 years
      @ChaiT.Rex done !
    • abinjacob
      abinjacob about 7 years
      @steeldriver do not know why but would want to know the reasons.
    • abinjacob
      abinjacob about 7 years
      @Zanna edited and details are added, please check!
    • steeldriver
      steeldriver about 7 years
      According to the stlink compiling manual it should be sufficient to run make release from the top-level directory - which should create a build directory and run the necessary cmake and make commands to configure and build the installation.
    • abinjacob
      abinjacob about 7 years
      @steeldriver i tried the command please check: abin@abin-Compaq-Presario-C700-Notebook-PC:~/ARMToolchains/s‌​tlink-master$ make release [RELEASE] make[1]: *** No targets specified and no makefile found. Stop. Makefile:27: recipe for target 'release' failed make: *** [release] Error 2 abin@abin-Compaq-Presario-C700-Notebook-PC:~/ARMToolchains/s‌​tlink-master$
  • abinjacob
    abinjacob about 7 years
    That's a clean answer, amazing. Anyhow in process i got this /home/abin/ARMToolchains/stlink-master# apt install build-essential automake dh-autoreconf libusb-1.0-0-dev cmake g++ The following extra packages will be installed: cmake-data Suggested packages: codeblocks eclipse ninja-build The following NEW packages will be installed: cmake cmake-data 0 upgraded, 2 newly installed, 0 to remove and 18 not upgraded. Need to get 3,324 kB of archives. After this operation, 16.4 MB of additional disk space will be used. Do you want to continue? [Y/n]
  • abinjacob
    abinjacob about 7 years
    All works fine, but for make install abin@abin-Compaq-Presario-C700-Notebook-PC:~/ARMToolchains/s‌​tlink-master$ pwd /home/abin/ARMToolchains/stlink-master abin@abin-Compaq-Presario-C700-Notebook-PC:~/ARMToolchains/s‌​tlink-master$ sudo make install make: *** No rule to make target 'install'. Stop.
  • Zanna
    Zanna about 7 years
    Hmm @abinjacob maybe you can run the executables from where they are... not at my box, so not sure
  • abinjacob
    abinjacob about 7 years
    don't leave like that , please answer
  • Zanna
    Zanna about 7 years
    @abinjacob I can't test it or look into it because I'm not at my machine now, I'm at work. I will take a look later :S
  • abinjacob
    abinjacob about 7 years
    gives hope , peace gn :)
  • Zanna
    Zanna about 7 years
    @abinjacob it works for me like so --> paste.ubuntu.com/24083002 see the install_manifest.txt inside the directory for where the files should go. I can only suggest you try the release version (linked in my answer) download it to your ~/Downloads directory and build from there. If that doesn't work, I have no idea, because I can't reproduce your problem :( Sorry!
  • Zanna
    Zanna about 7 years
    @abinjacob however, when you try it like this, you can copy and paste the output from all commands here and put the link to your paste here and I can take a look
  • abinjacob
    abinjacob about 7 years
    What is the "release version" mentioned in your comment.
  • Zanna
    Zanna about 7 years
    I installed a release from GitHub rather than cloning the master click here to download it @abinjacob
  • abinjacob
    abinjacob about 7 years
    make install did run, in build folder. It did work!! it was not running before because i used "cmake" instead of "cmake .." .What is the significance of ".."?
  • Zanna
    Zanna about 7 years
    it signifies the parent directory, where the CMakeFiles are located. Glad you got it working! @abinjacob