Thread: Make Error with Osmo TRX

  1. #1
    Registered User
    Join Date
    Sep 2013
    Posts
    12

    Exclamation Make Error with Osmo TRX

    Greetings!

    I’m not sure if I am on the right board or not, however, I figured this was the closest one - please correct me if I'm wrong (I'm still pretty new to the site). I recently got stuck with an error with making Osmo-TRX and need some help.



    To give you some background, I am doing a project with OpenBTS and GSM. My project is being built on the small, yet powerful Beaglebone Black. As you might know, Osmo TRX is one of the few ARM-friendly transceivers for OpenBTS. I was following the instructions as provided on the main website (http://openbsc.osmocom.org/trac/wiki/OsmoTRX) to install it and when it came time to make the project, I ran across an error:



    Code:
    Make: ***No rule to make target ‘/Makefile.common’, needed by ‘Makefile.in’. Stop.
    I am using the code from the github site (https://github.com/osmocom/osmo-trx). Unfortunately, I could not diagnose the bug and the error.

    Would anyone be able to assist me? Thank you so much for your help, I really do appreciate it!



    As an added note:

    Another error that I ran into that you might want to know about is when I ran “autoreconf –i”, I got an error saying:

    Code:
    C objects in subdir but ‘AM_PROG_CC_C_0’ not in ‘configure.ac’
    Which caused automake to fail with exit status 1. However, simply adding ‘AM_PROG_CC_C_0’ to the file configure.ac seemed to fix the problem.

    Thanks again!
    Last edited by billyjthorton; 09-23-2015 at 03:00 PM. Reason: Forgot website

  2. #2
    Registered User
    Join Date
    Sep 2013
    Posts
    12
    EDIT: I was able to mess around in the configure file and eventually got it to Make. However, I have yet again run into another error that I would appreciate some help on. In the file convert.c:

    Code:
    #include <malloc.h>
    #include <string.h>
    #include "convert.h"
    
    #ifdef HAVE_CONFIG_H
    #include "config.h"
    #endif
    
    void neon_convert_ps_si16_4n(short *, float *, float *, int);
    void neon_convert_si16_ps_4n(float *, short *, int);
    
    #ifndef HAVE_NEON
    static void convert_si16_ps(float *out, short *in, int len)
    {
        for (int i = 0; i < len; i++)
            out[i] = in[i];
    }
    
    static void convert_ps_si16(short *out, float *in, float scale, int len)
    {
        for (int i = 0; i < len; i++)
            out[i] = in[i] * scale;
    }
    #else
    /* 4*N 16-bit signed integer conversion with remainder */
    static void neon_convert_si16_ps(float *restrict out,
                     short *restrict in,
                     int len)
    {
        int start = len / 4 * 4;
    
        neon_convert_si16_ps_4n(out, in, len >> 2);
    
        for (int i = 0; i < len % 4; i++)
            out[start + i] = (float) in[start + i];
    }
    
    /* 4*N 16-bit signed integer conversion with remainder */
    static void neon_convert_ps_si16(short *restrict out,
                     float *restrict in,
                     float *restrict scale,
                     int len)
    {
        int start = len / 4 * 4;
    
        neon_convert_ps_si16_4n(out, in, scale, len >> 2);
    
        for (int i = 0; i < len % 4; i++)
            out[start + i] = (short) (in[start + i] * (*scale));
    }
    #endif
    
    void convert_float_short(short *out, float *in, float scale, int len)
    {
    #ifdef HAVE_NEON
            float q[4] = { scale, scale, scale, scale };
    
        if (len % 4)
            neon_convert_ps_si16(out, in, q, len);
        else
            neon_convert_ps_si16_4n(out, in, q, len >> 2);
    #else
        convert_ps_si16(out, in, scale, len);
    #endif
    }
    
    void convert_short_float(float *out, short *in, int len)
    {
    #ifdef HAVE_NEON
        if (len % 4)
            neon_convert_si16_ps(out, in, len);
        else
            neon_convert_si16_ps_4n(out, in, len >> 2);
    #else
        convert_si16_ps(out, in, len);
    #endif
    }
    Here is the header file convert.h:

    Code:
    #ifndef _CONVERT_H_
    #define _CONVERT_H_
    
    void convert_float_short(short *out, const float *in, float scale, int len);
    void convert_short_float(float *out, const short *in, int len);
    
    #endif /* _CONVERT_H_ */
    I ran into the error:

    Code:
    convert.c:86:6: error: conflicting types for 'convert_short_float'
     void convert_short_float(float *out, short *in, int len)
    I don't see anything particularly wrong with this include statement - especially with the include guard. Does anyone else have a clue as to what might be the issue?
    Last edited by billyjthorton; 09-24-2015 at 08:13 AM.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    Look closely at the second parameter and note the difference. A const qualified parameter is not the same as a non-const qualified parameter.


    Jim

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Your include guard is wrong: all identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved (by the implementation) for any use. You could easily change it to:
    Code:
    #ifndef BILLY_CONVERT_H_
    #define BILLY_CONVERT_H_
    However, while this is a mistake that should be fixed, it is unlikely to be the problem that caused the error. Rather, look carefully. In the header, you declared:
    Code:
    void convert_short_float(float *out, const short *in, int len);
    But the compiler observed the conflict with:
    Code:
    void convert_short_float(float *out, short *in, int len)
    In other words, you forgot the const keyword when defining the function.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Sep 2013
    Posts
    12
    Thank you so much for your reply! I really appreciate it! I didn't know that about the include guard. So instead of:

    Code:
    #ifndef _CONVERT_H_
    It should be

    Code:
    #ifndef CONVERT_H_
    If I understand correctly?

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yes, or some other name that is unique, satisfies the requirements without being reserved to the implementation.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. make: *** [transform] Error 1
    By Cody Hutto in forum C Programming
    Replies: 11
    Last Post: 04-19-2015, 11:27 PM
  2. Error that does not make sense.
    By gipper in forum C Programming
    Replies: 7
    Last Post: 11-28-2012, 10:25 PM
  3. Simple Make Error
    By Aparavoid in forum Tech Board
    Replies: 7
    Last Post: 07-05-2009, 06:39 AM
  4. does this error make sense
    By chico1st in forum C Programming
    Replies: 6
    Last Post: 05-27-2008, 11:47 AM
  5. Dev-C++ make.exe error
    By beanroaster in forum C++ Programming
    Replies: 3
    Last Post: 01-26-2008, 11:07 AM

Tags for this Thread