cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

441
Views
0
Helpful
4
Replies
Highlighted
Beginner

ydk-cpp installation: Error building YDK

Hello, I was trying to install ydk-cpp on my mac(OS 10.14.2) and got a problem. I had already installed Pcre by brew install pcre but it reports fatal error: 'pcre.h' file not found. I have followed all the steps successfully on https://github.com/CiscoDevNet/ydk-cpp until Building YDK. Can anyone help me? 

 

Here is the record:

MBPE:~ eric$ git clone https://github.com/CiscoDevNet/ydk-cpp.git

Cloning into 'ydk-cpp'...

remote: Enumerating objects: 325, done.

remote: Counting objects: 100% (325/325), done.

remote: Compressing objects: 100% (232/232), done.

remote: Total 23857 (delta 159), reused 205 (delta 59), pack-reused 23532

Receiving objects: 100% (23857/23857), 278.64 MiB | 2.97 MiB/s, done.

Resolving deltas: 100% (22504/22504), done.

Checking out files: 100% (3298/3298), done.

MBPE:~ eric$ cd ydk-cpp

MBPE:ydk-cpp eric$ cd core/ydk

MBPE:ydk eric$ mkdir build && cd build

MBPE:build eric$ cmake .. && make

-- The C compiler identification is AppleClang 10.0.0.10001145

-- The CXX compiler identification is AppleClang 10.0.0.10001145

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

CMake System: MacOS

-- Found LibXml2: /usr/lib/libxml2.dylib (found version "2.9.4")

Set libyang plugin installation directory to: lib/libyang

-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.14") found components:  doxygen missing components:  dot

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/eric/ydk-cpp/core/ydk/build

Scanning dependencies of target project_libnetconf

[  1%] Creating directories for 'project_libnetconf'

[  1%] Performing download step (download, verify and extract) for 'project_libnetconf'

-- Downloading...

   dst='/Users/eric/ydk-cpp/core/ydk/build/project_libnetconf/src/master.zip'

   timeout='none'

-- Using src='https://github.com/abhikeshav/libnetconf/archive/master.zip'

-- Downloading... done

-- extracting...

     src='/Users/eric/ydk-cpp/core/ydk/build/project_libnetconf/src/master.zip'

     dst='/Users/eric/ydk-cpp/core/ydk/build/project_libnetconf/src/project_libnetconf'

-- extracting... [tar xfz]

-- extracting... [analysis]

-- extracting... [rename]

-- extracting... [clean up]

-- extracting... done

[  2%] No patch step for 'project_libnetconf'

[  3%] No update step for 'project_libnetconf'

[  4%] Performing configure step for 'project_libnetconf'

checking build system type... x86_64-apple-darwin18.2.0

checking host system type... x86_64-apple-darwin18.2.0

sed: first RE may not be empty

checking for pkg-config... /usr/local/bin/pkg-config

checking for pyang... no

checking for xsltproc... yes

checking for host architecture... x86_64 is supported

checking for doxygen... doxygen

checking for rpmbuild... no

checking for greadlink... readlink

configure: WARNING: Try installing greadlink.

checking for libtool... yes

checking for clang... clang

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether clang accepts -g... yes

checking for clang option to accept ISO C89... none needed

checking how to run the C preprocessor... clang -E

checking whether ln -s works... yes

checking for a BSD-compatible install... /usr/bin/install -c

checking how to print strings... printf

checking for a sed that does not truncate output... /usr/bin/sed

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for fgrep... /usr/bin/grep -F

checking for ld used by clang... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld

checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no

checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B

checking the name lister (/usr/bin/nm -B) interface... BSD nm

checking the maximum length of command line arguments... 196608

checking whether the shell understands some XSI constructs... yes

checking whether the shell understands "+="... yes

checking how to convert x86_64-apple-darwin18.2.0 file names to x86_64-apple-darwin18.2.0 format... func_convert_file_noop

checking how to convert x86_64-apple-darwin18.2.0 file names to toolchain format... func_convert_file_noop

checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r

checking for objdump... objdump

checking how to recognize dependent libraries... pass_all

checking for dlltool... no

checking how to associate runtime and link libraries... printf %s\n

checking for ar... ar

checking for archiver @FILE support... no

checking for strip... strip

checking for ranlib... ranlib

checking for gawk... no

checking for mawk... no

checking for nawk... no

checking for awk... awk

checking command to parse /usr/bin/nm -B output from clang object... ok

checking for sysroot... no

checking for mt... no

checking if : is a manifest tool... no

checking for dsymutil... dsymutil

checking for nmedit... nmedit

checking for lipo... lipo

checking for otool... otool

checking for otool64... no

checking for -single_module linker flag... yes

checking for -exported_symbols_list linker flag... yes

checking for -force_load linker flag... yes

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking for dlfcn.h... yes

checking for objdir... .libs

checking if clang supports -fno-rtti -fno-exceptions... yes

checking for clang option to produce PIC... -fno-common -DPIC

checking if clang PIC flag -fno-common -DPIC works... yes

checking if clang static flag -static works... no

checking if clang supports -c -o file.o... yes

checking if clang supports -c -o file.o... (cached) yes

checking whether the clang linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes

checking dynamic linker characteristics... darwin18.2.0 dyld

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... yes

checking for ELF visibility... yes

checking for xml2-config... yes

checking for xmlDOMWrapReconcileNamespaces in -lxml2... yes

checking for xslt-config... yes

checking for xsltApplyStylesheet in -lxslt... yes

checking libxslt/transform.h usability... yes

checking libxslt/transform.h presence... no

configure: WARNING: libxslt/transform.h: accepted by the compiler, rejected by the preprocessor!

configure: WARNING: libxslt/transform.h: proceeding with the compiler's result

checking for libxslt/transform.h... yes

checking libxslt/xsltInternals.h usability... yes

checking libxslt/xsltInternals.h presence... no

configure: WARNING: libxslt/xsltInternals.h: accepted by the compiler, rejected by the preprocessor!

configure: WARNING: libxslt/xsltInternals.h: proceeding with the compiler's result

checking for libxslt/xsltInternals.h... yes

checking for ssh_pki_key_ecdsa_name in -lssh... yes

checking libssh/libssh.h usability... yes

checking libssh/libssh.h presence... yes

checking for libssh/libssh.h... yes

checking for ssh_threads_get_pthread in -lssh_threads... yes

./configure: line 12246: /Applications: is a directory

./configure: line 12247: dev-tools/: is a directory

checking whether pthreads work with -pthread... yes

checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE

checking if more special flags are required for pthreads... -D_THREAD_SAFE

checking for PTHREAD_PRIO_INHERIT... yes

checking pthread.h usability... yes

checking pthread.h presence... yes

checking for pthread.h... yes

checking for library containing sem_init... none required

checking pkg-config is at least version 0.9.0... yes

checking fcntl.h usability... yes

checking fcntl.h presence... yes

checking for fcntl.h... yes

checking limits.h usability... yes

checking limits.h presence... yes

checking for limits.h... yes

checking netdb.h usability... yes

checking netdb.h presence... yes

checking for netdb.h... yes

checking stddef.h usability... yes

checking stddef.h presence... yes

checking for stddef.h... yes

checking for stdint.h... (cached) yes

checking for stdlib.h... (cached) yes

checking for string.h... (cached) yes

checking sys/file.h usability... yes

checking sys/file.h presence... yes

checking for sys/file.h... yes

checking sys/socket.h usability... yes

checking sys/socket.h presence... yes

checking for sys/socket.h... yes

checking termios.h usability... yes

checking termios.h presence... yes

checking for termios.h... yes

checking for unistd.h... (cached) yes

checking utmpx.h usability... yes

checking utmpx.h presence... yes

checking for utmpx.h... yes

checking for stdbool.h that conforms to C99... yes

checking for _Bool... yes

checking for uid_t in sys/types.h... yes

checking for inline... inline

checking for int32_t... yes

checking for mode_t... yes

checking for off_t... yes

checking for pid_t... yes

checking for size_t... yes

checking for ssize_t... yes

checking for uint8_t... yes

checking for uint16_t... yes

checking for uint64_t... yes

checking type of array argument to getgroups... gid_t

checking for getgroups... yes

checking for working getgroups... yes

checking for stdlib.h... (cached) yes

checking for GNU libc compatible malloc... yes

checking for stdlib.h... (cached) yes

checking for unistd.h... (cached) yes

checking for sys/param.h... yes

checking for getpagesize... yes

checking for working mmap... yes

checking for stdlib.h... (cached) yes

checking for GNU libc compatible realloc... yes

checking for ftruncate... yes

checking for memset... yes

checking for mkdir... yes

checking for munmap... yes

checking for socket... yes

checking for strcasecmp... yes

checking for strchr... yes

checking for strdup... yes

checking for strerror... yes

checking for strrchr... yes

checking for strstr... yes

checking for strtol... yes

checking for strtoul... yes

checking for eaccess... no

checking for dot... NO

configure: WARNING: Due to missing pyang, lnctool will not work.

configure: creating ./config.status

config.status: creating dev-tools/lncdatastore/Makefile

config.status: creating Makefile

config.status: creating src/config.h

config.status: creating libnetconf.spec

config.status: creating libnetconf.pc

config.status: creating Doxyfile

config.status: creating headers/libnetconf.h

config.status: creating headers/libnetconf_xml.h

config.status: creating headers/libnetconf_ssh.h

config.status: executing libtool commands

[  5%] Performing build step for 'project_libnetconf'

readlink: illegal option -- f

usage: readlink [-n] [file ...]

src/internal.c:847:43: warning: passing 'gid_t *' (aka 'unsigned int *') to parameter of type

      'int *' converts between pointers to integer types with different sign [-Wpointer-sign]

                        if (getgrouplist(username, pp->pw_gid, glist, &i) != -1) {

                                                               ^~~~~

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/unistd.h:653:43: note:

      passing argument to parameter here

int      getgrouplist(const char *, int, int *, int *);

                                              ^

1 warning generated.

src/datastore.c:667:12: warning: unused function 'fmon_restore_file' [-Wunused-function]

static int fmon_restore_file(const char* target)

           ^

src/datastore.c:683:12: warning: unused function 'fmon_backup_file' [-Wunused-function]

static int fmon_backup_file(const char* source)

           ^

2 warnings generated.

[  6%] Performing install step for 'project_libnetconf'

[  7%] Completed 'project_libnetconf'

[  7%] Built target project_libnetconf

Scanning dependencies of target project_libyang

[  8%] Creating directories for 'project_libyang'

[  9%] Performing download step (download, verify and extract) for 'project_libyang'

-- Downloading...

   dst='/Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/master.zip'

   timeout='none'

-- Using src='https://github.com/ygorelik/libyang/archive/master.zip'

-- Downloading... done

-- extracting...

     src='/Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/master.zip'

     dst='/Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/project_libyang'

-- extracting... [tar xfz]

-- extracting... [analysis]

-- extracting... [rename]

-- extracting... [clean up]

-- extracting... done

[ 10%] No patch step for 'project_libyang'

[ 11%] No update step for 'project_libyang'

[ 11%] Performing configure step for 'project_libyang'

-- The C compiler identification is AppleClang 10.0.0.10001145

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Found FLEX: /usr/bin/flex (found version "2.5.35")

-- Found BISON: /usr/bin/bison (found version "2.3")

CMake Warning at CMakeLists.txt:134 (message):

  Missing tools (devscripts, debhelper package) for building deb package.

 

  You won't be able to generate deb package from source code.

 

  Compiling libyang should still works fine.

 

 

CMake Warning at CMakeLists.txt:145 (message):

  Missing tools (rpm package) for building rpm package.

 

  You won't be able to generate rpm package from source code.

 

  Compiling libyang should still works fine.

 

 

-- Found PCRE: /usr/local/lib/libpcre.dylib 

-- Looking for pthread.h

-- Looking for pthread.h - found

-- Looking for pthread_create

-- Looking for pthread_create - found

-- Found Threads: TRUE 

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")

-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.14") found components:  doxygen missing components:  dot

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/project_libyang-build

[ 12%] Performing build step for 'project_libyang'

Scanning dependencies of target yang_static

[  2%] Building C object CMakeFiles/yang_static.dir/src/common.c.o

In file included from /Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/project_libyang/src/common.c:29:

/Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/project_libyang/src/parser.h:18:10: fatal error:

      'pcre.h' file not found

#include <pcre.h>

         ^~~~~~~~

1 error generated.

make[5]: *** [CMakeFiles/yang_static.dir/src/common.c.o] Error 1

make[4]: *** [CMakeFiles/yang_static.dir/all] Error 2

make[3]: *** [all] Error 2

make[2]: *** [project_libyang/src/project_libyang-stamp/project_libyang-build] Error 2

make[1]: *** [CMakeFiles/project_libyang.dir/all] Error 2

make: *** [all] Error 2

MBPE:build eric$ brew install pcre

Updating Homebrew...

==> Auto-updated Homebrew!

Updated 1 tap (homebrew/core).

==> Updated Formulae

docker                            mesa                              platformio

 

Warning: pcre 8.42 is already installed and up-to-date

To reinstall 8.42, run `brew reinstall pcre`

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: ydk-cpp installation: Error building YDK

Hi Eric
Something is wrong with your PCRE installation. Check 'pcre.h' file permission and ownership. Make sure there are no conflicts. Maybe try to build test program just to include the pcre.h.
I am sure this is not YDK issue.

View solution in original post

4 REPLIES 4
Cisco Employee

Re: ydk-cpp installation: Error building YDK

Hi Eric


Could you please verify PCRE installation on your Mac.


On my Mac VM it is located here:


Yans-iMac:build yangorelik$ locate pcre.h

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/ext/pcre/php_pcre.h

/usr/include/php/ext/pcre/php_pcre.h

/usr/local/Cellar/pcre/8.42/include/pcre.h

/usr/local/Cellar/pcre/8.42/share/doc/pcre/html/pcre.html

/usr/local/include/pcre.h

Yans-iMac:build yangorelik$ ls -l /usr/local/include/pcre.h

lrwxr-xr-x 1 yangorelik admin 34 Oct 9 15:21 /usr/local/include/pcre.h -> ../Cellar/pcre/8.42/include/pcre.h?

?Hopefully you can fix this.

Regards,
Yan
Beginner

Re: ydk-cpp installation: Error building YDK

I have done reinstall pcre for several times and my location is same as yours, but a few more files.
MBPE:~ eric$ locate pcre.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/php/ext/pcre/php_pcre.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/php/ext/pcre/php_pcre.h
/Users/eric/ydk-cpp/core/ydk/build/project_libyang/src/project_libyang/src/pcre.h
/usr/local/Cellar/pcre/8.42/include/pcre.h
/usr/local/Cellar/pcre/8.42/share/doc/pcre/html/pcre.html
/usr/local/include/libyang/pcre.h
/usr/local/include/pcre.h
MBPE:~ eric$ ls -l /usr/local/include/pcre.h
lrwxr-xr-x 1 eric admin 34 Dec 12 14:07 /usr/local/include/pcre.h -> ../Cellar/pcre/8.42/include/pcre.h
Cisco Employee

Re: ydk-cpp installation: Error building YDK

Hi Eric
Something is wrong with your PCRE installation. Check 'pcre.h' file permission and ownership. Make sure there are no conflicts. Maybe try to build test program just to include the pcre.h.
I am sure this is not YDK issue.

View solution in original post

Beginner

Re: ydk-cpp installation: Error building YDK

I tried to build a test program in C which just includes pcre.h #include <pcre.h> in the same position as parser.h, which reported the error above, and it can be compiled. I cannot understand why there are in the same position but one reports error but the other not.
Content for Community-Ad
FusionCharts will render here
This widget could not be displayed.