Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building in-source with CMake #5285

Closed
shosca opened this issue Sep 2, 2016 · 8 comments
Closed

Error when building in-source with CMake #5285

shosca opened this issue Sep 2, 2016 · 8 comments
Labels
build building and installing Neovim using the provided scripts complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md

Comments

@shosca
Copy link
Sponsor

shosca commented Sep 2, 2016

  • nvim --version: n/a
  • Vim (version: ) behaves differently? n/a
  • Operating system/version: CentOS 6.8 with devtoolset-4
  • Terminal name/version: Gnome Terminal
  • $TERM:

Actual behaviour

Build failure with cc1: fatal error: opening output file /home/vagrant/src/neovim/src/nvim/auto/auto/api/private/dispatch.i: No such file or directory

Expected behaviour

It builds

Steps to reproduce using nvim -u NORC

n/a

nvim -u NORC
n/a

Probably happening because there's an extra auto in the path.

$ git bisect bad
de3a515123fa417ecce61efebe4bc117b010c657 is the first bad commit
commit de3a515123fa417ecce61efebe4bc117b010c657
Author: Björn Linse <bjorn.linse@gmail.com>
Date:   Thu Jun 16 13:35:04 2016 +0200

    api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the header generator.

:040000 040000 57d93505372acecc27a399f0dceb952691e2d29a c245202882eb29e71f5397c870ab1bb2eb9a529f M      scripts
:040000 040000 7039ce9858d97fbda6d4959a109848e6e7d44255 80808352199872e03ebff39708b625a26e483344 M      src
@bfredl
Copy link
Member

bfredl commented Sep 2, 2016

Does make distclean help?

@shosca
Copy link
Sponsor Author

shosca commented Sep 2, 2016

I did git clean -xfd rerun cmake && make during bisect

@shosca
Copy link
Sponsor Author

shosca commented Sep 2, 2016

Full build log on master

$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib64 && make
-- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
-- Check for working C compiler: /opt/rh/devtoolset-4/root/usr/bin/cc
-- Check for working C compiler: /opt/rh/devtoolset-4/root/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/devtoolset-4/root/usr/bin/c++
-- Check for working CXX compiler: /opt/rh/devtoolset-4/root/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.
-- Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2.
-- Performing Test HAS_OG_FLAG
-- Performing Test HAS_OG_FLAG - Success
-- Performing Test HAS_ACCEPTABLE_FORTIFY
-- Performing Test HAS_ACCEPTABLE_FORTIFY - Success
-- Performing Test HAS_WVLA_FLAG
-- Performing Test HAS_WVLA_FLAG - Success
-- Performing Test HAS_FSTACK_PROTECTOR_STRONG_FLAG
-- Performing Test HAS_FSTACK_PROTECTOR_STRONG_FLAG - Success
-- Performing Test HAS_FSTACK_PROTECTOR_FLAG
-- Performing Test HAS_FSTACK_PROTECTOR_FLAG - Success
-- Performing Test HAS_DIAG_COLOR_FLAG
-- Performing Test HAS_DIAG_COLOR_FLAG - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for kstat_lookup in kstat
-- Looking for kstat_lookup in kstat - not found
-- Looking for kvm_open in kvm
-- Looking for kvm_open in kvm - not found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - found
-- Looking for perfstat_cpu in perfstat
-- Looking for perfstat_cpu in perfstat - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for sendfile in sendfile
-- Looking for sendfile in sendfile - not found
-- Found LibUV: /usr/lib64/libuv.so
-- Found Msgpack: /usr/lib64/libmsgpackc.so (found suitable version "1.4.1", minimum required is "1.0.0")
-- Found unibilium: /usr/lib64/libunibilium.so
-- Found LibTermkey: /usr/lib/libtermkey.so
-- Found LibVterm: /usr/lib/libvterm.so
-- Found JeMalloc: /usr/lib64/libjemalloc.so
-- Performing Test HAVE_WORKING_LIBINTL
-- Performing Test HAVE_WORKING_LIBINTL - Success
-- Looking for _nl_msg_cat_cntr
-- Looking for _nl_msg_cat_cntr - found
-- Found Iconv
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Checking Lua interpreter /usr/bin/luajit
-- Using the Lua interpreter /usr/bin/luajit.
-- Log level not specified, defaulting to INFO(1)
-- Found Gettext: /usr/bin/msgmerge (found version "0.17")
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of intmax_t
-- Check size of intmax_t - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of long long
-- Check size of long long - done
-- Check size of void *
-- Check size of void * - done
-- Looking for _NSGetEnviron
-- Looking for _NSGetEnviron - not found
-- Looking for include file iconv.h
-- Looking for include file iconv.h - found
-- Looking for include file langinfo.h
-- Looking for include file langinfo.h - found
-- Looking for include file locale.h
-- Looking for include file locale.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file sys/wait.h
-- Looking for include file sys/wait.h - found
-- Looking for include file sys/utsname.h
-- Looking for include file sys/utsname.h - found
-- Looking for include file utime.h
-- Looking for include file utime.h - found
-- Looking for include file sys/uio.h
-- Looking for include file sys/uio.h - found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for getpwent
-- Looking for getpwent - found
-- Looking for getpwnam
-- Looking for getpwnam - found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for uv_translate_sys_error
-- Looking for uv_translate_sys_error - not found
-- Looking for readv
-- Looking for readv - found
-- Looking for _putenv_s
-- Looking for _putenv_s - not found
-- Looking for opendir
-- Looking for opendir - found
-- Looking for readlink
-- Looking for readlink - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for setpgid
-- Looking for setpgid - found
-- Looking for setsid
-- Looking for setsid - found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for utime
-- Looking for utime - found
-- Looking for utimes
-- Looking for utimes - found
-- Looking for FD_CLOEXEC
-- Looking for FD_CLOEXEC - found
-- Looking for CODESET
-- Looking for CODESET - found
-- Looking for include file endian.h
-- Looking for include file endian.h - found
-- Looking for include file sys/endian.h
-- Looking for include file sys/endian.h - not found
-- Performing Test HAVE_BE64TOH_MACROS
-- Performing Test HAVE_BE64TOH_MACROS - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vagrant/src/neovim
Scanning dependencies of target sjiscorr
[  0%] Generating auto/api/buffer.c.generated.h, ../../include/api/buffer.h.generated.h
[  0%] Building C object src/nvim/po/CMakeFiles/sjiscorr.dir/sjiscorr.c.o
Linking C executable ../../../bin/sjiscorr
[  0%] Generating auto/api/tabpage.c.generated.h, ../../include/api/tabpage.h.generated.h
[  0%] Built target sjiscorr
Scanning dependencies of target translations
[  0%] Generating nvim.pot
[  0%] Generating auto/api/ui.c.generated.h, ../../include/api/ui.h.generated.h
[  0%] Generating auto/api/vim.c.generated.h, ../../include/api/vim.h.generated.h
[  0%] Generating auto/api/window.c.generated.h, ../../include/api/window.h.generated.h
[  3%] Generating auto/api/private/handle.c.generated.h, ../../include/api/private/handle.h.generated.h
[  3%] Generating auto/api/private/helpers.c.generated.h, ../../include/api/private/helpers.h.generated.h
[  6%] Generating ja.euc-jp.mo
[  6%] Generating cs.cp1250.mo
[  6%] Generating pl.cp1250.mo
[  6%] Generating auto/arabic.c.generated.h, ../../include/arabic.h.generated.h
[  6%] Generating pl.UTF-8.mo
[  6%] Generating sk.cp1250.mo
[  6%] Generating auto/buffer.c.generated.h, ../../include/buffer.h.generated.h
[  6%] Generating ru.cp1251.mo
[  6%] Generating uk.cp1251.mo
[  6%] Generating ko.mo
[  9%] Generating auto/charset.c.generated.h, ../../include/charset.h.generated.h
[ 12%] Generating zh_CN.cp936.mo
[ 12%] Generating nb.mo
[ 12%] Generating auto/cursor.c.generated.h, ../../include/cursor.h.generated.h
[ 12%] Generating ja.sjis.mo
[ 12%] Generating af.mo
[ 12%] Generating auto/cursor_shape.c.generated.h, ../../include/cursor_shape.h.generated.h
[ 12%] Generating ca.mo
[ 12%] Generating cs.mo
[ 12%] Generating auto/diff.c.generated.h, ../../include/diff.h.generated.h
[ 12%] Generating de.mo
[ 15%] Generating en_GB.mo
[ 15%] [ 15%] Generating eo.mo
Generating auto/digraph.c.generated.h, ../../include/digraph.h.generated.h
[ 15%] Generating es.mo
[ 15%] [ 15%] Generating fi.mo
Generating auto/edit.c.generated.h, ../../include/edit.h.generated.h
[ 15%] Generating fr.mo
[ 15%] Generating ga.mo
[ 15%] [ 15%] Generating it.mo
Generating auto/eval.c.generated.h, ../../include/eval.h.generated.h
[ 15%] Generating ja.mo
[ 18%] Generating ko.UTF-8.mo
[ 18%] Generating nl.mo
[ 18%] Generating no.mo
[ 18%] Generating pl.mo
[ 18%] Generating pt_BR.mo
[ 18%] [ 21%] Generating ru.mo
Generating auto/eval/decode.c.generated.h, ../../include/eval/decode.h.generated.h
[ 21%] Generating sk.mo
[ 21%] Generating sv.mo
[ 25%] [ 25%] Generating auto/eval/encode.c.generated.h, ../../include/eval/encode.h.generated.h
Generating uk.mo
[ 25%] Generating vi.mo
[ 25%] Generating zh_CN.mo
[ 25%] Generating zh_CN.UTF-8.mo
[ 25%] Generating auto/event/libuv_process.c.generated.h, ../../include/event/libuv_process.h.generated.h
[ 25%] Generating zh_TW.mo
[ 25%] [ 25%] Generating auto/event/loop.c.generated.h, ../../include/event/loop.h.generated.h
Generating zh_TW.UTF-8.mo
[ 25%] Built target translations
Scanning dependencies of target shell-test
[ 25%] Generating auto/event/process.c.generated.h, ../../include/event/process.h.generated.h
[ 25%] Building C object test/functional/fixtures/CMakeFiles/shell-test.dir/shell-test.c.o
[ 25%] Generating auto/event/queue.c.generated.h, ../../include/event/queue.h.generated.h
Linking C executable ../../../bin/shell-test
[ 25%] Built target shell-test
[ 25%] Scanning dependencies of target tty-test
Generating auto/event/rstream.c.generated.h, ../../include/event/rstream.h.generated.h
[ 25%] Building C object test/functional/fixtures/CMakeFiles/tty-test.dir/tty-test.c.o
[ 25%] Generating auto/event/signal.c.generated.h, ../../include/event/signal.h.generated.h
Linking C executable ../../../bin/tty-test
[ 28%] Generating auto/event/socket.c.generated.h, ../../include/event/socket.h.generated.h
[ 28%] Built target tty-test
[ 28%] Generating auto/event/stream.c.generated.h, ../../include/event/stream.h.generated.h
[ 28%] Generating auto/event/time.c.generated.h, ../../include/event/time.h.generated.h
[ 28%] Generating auto/event/wstream.c.generated.h, ../../include/event/wstream.h.generated.h
[ 28%] Generating auto/ex_cmds.c.generated.h, ../../include/ex_cmds.h.generated.h
[ 28%] Generating auto/ex_cmds2.c.generated.h, ../../include/ex_cmds2.h.generated.h
[ 28%] Generating auto/ex_docmd.c.generated.h, ../../include/ex_docmd.h.generated.h
[ 28%] Generating auto/ex_eval.c.generated.h, ../../include/ex_eval.h.generated.h
[ 31%] Generating auto/ex_getln.c.generated.h, ../../include/ex_getln.h.generated.h
[ 31%] Generating auto/farsi.c.generated.h, ../../include/farsi.h.generated.h
[ 31%] Generating auto/file_search.c.generated.h, ../../include/file_search.h.generated.h
[ 31%] Generating auto/fileio.c.generated.h, ../../include/fileio.h.generated.h
[ 31%] Generating auto/fold.c.generated.h, ../../include/fold.h.generated.h
[ 31%] Generating auto/garray.c.generated.h, ../../include/garray.h.generated.h
[ 31%] Generating auto/getchar.c.generated.h, ../../include/getchar.h.generated.h
[ 31%] Generating auto/hardcopy.c.generated.h, ../../include/hardcopy.h.generated.h
[ 34%] Generating auto/hashtab.c.generated.h, ../../include/hashtab.h.generated.h
[ 34%] Generating auto/if_cscope.c.generated.h, ../../include/if_cscope.h.generated.h
[ 34%] Generating auto/indent.c.generated.h, ../../include/indent.h.generated.h
[ 34%] Generating auto/indent_c.c.generated.h, ../../include/indent_c.h.generated.h
[ 34%] Generating auto/keymap.c.generated.h, ../../include/keymap.h.generated.h
[ 34%] Generating auto/log.c.generated.h, ../../include/log.h.generated.h
[ 34%] Generating auto/main.c.generated.h, ../../include/main.h.generated.h
[ 34%] Generating auto/map.c.generated.h, ../../include/map.h.generated.h
[ 37%] Generating auto/mark.c.generated.h, ../../include/mark.h.generated.h
[ 37%] Generating auto/mbyte.c.generated.h, ../../include/mbyte.h.generated.h
[ 37%] Generating auto/memfile.c.generated.h, ../../include/memfile.h.generated.h
[ 37%] Generating auto/memline.c.generated.h, ../../include/memline.h.generated.h
[ 37%] Generating auto/memory.c.generated.h, ../../include/memory.h.generated.h
[ 37%] Generating auto/menu.c.generated.h, ../../include/menu.h.generated.h
[ 37%] Generating auto/message.c.generated.h, ../../include/message.h.generated.h
[ 37%] Generating auto/misc1.c.generated.h, ../../include/misc1.h.generated.h
[ 40%] Generating auto/misc2.c.generated.h, ../../include/misc2.h.generated.h
[ 40%] Generating auto/mouse.c.generated.h, ../../include/mouse.h.generated.h
[ 40%] Generating auto/move.c.generated.h, ../../include/move.h.generated.h
[ 40%] Generating auto/msgpack_rpc/channel.c.generated.h, ../../include/msgpack_rpc/channel.h.generated.h
[ 40%] Generating auto/msgpack_rpc/helpers.c.generated.h, ../../include/msgpack_rpc/helpers.h.generated.h
[ 40%] Generating auto/msgpack_rpc/server.c.generated.h, ../../include/msgpack_rpc/server.h.generated.h
[ 40%] Generating auto/normal.c.generated.h, ../../include/normal.h.generated.h
[ 40%] Generating auto/ops.c.generated.h, ../../include/ops.h.generated.h
[ 43%] Generating auto/option.c.generated.h, ../../include/option.h.generated.h
[ 43%] Generating auto/os/dl.c.generated.h, ../../include/os/dl.h.generated.h
[ 43%] Generating auto/os/env.c.generated.h, ../../include/os/env.h.generated.h
[ 43%] Generating auto/os/fileio.c.generated.h, ../../include/os/fileio.h.generated.h
[ 43%] Generating auto/os/fs.c.generated.h, ../../include/os/fs.h.generated.h
[ 43%] Generating auto/os/input.c.generated.h, ../../include/os/input.h.generated.h
[ 43%] Generating auto/os/mem.c.generated.h, ../../include/os/mem.h.generated.h
[ 43%] Generating auto/os/pty_process_unix.c.generated.h, ../../include/os/pty_process_unix.h.generated.h
[ 46%] Generating auto/os/shell.c.generated.h, ../../include/os/shell.h.generated.h
[ 46%] Generating auto/os/signal.c.generated.h, ../../include/os/signal.h.generated.h
[ 46%] [ 46%] Generating auto/os/stdpaths.c.generated.h, ../../include/os/stdpaths.h.generated.h
Generating auto/os/time.c.generated.h, ../../include/os/time.h.generated.h
[ 46%] [ 46%] Generating auto/os/users.c.generated.h, ../../include/os/users.h.generated.h
Generating auto/os_unix.c.generated.h, ../../include/os_unix.h.generated.h
[ 46%] Generating auto/path.c.generated.h, ../../include/path.h.generated.h
[ 46%] Generating auto/popupmnu.c.generated.h, ../../include/popupmnu.h.generated.h
[ 50%] Generating auto/profile.c.generated.h, ../../include/profile.h.generated.h
[ 50%] Generating auto/quickfix.c.generated.h, ../../include/quickfix.h.generated.h
[ 50%] Generating auto/rbuffer.c.generated.h, ../../include/rbuffer.h.generated.h
[ 50%] Generating auto/regexp.c.generated.h, ../../include/regexp.h.generated.h
[ 50%] Generating auto/screen.c.generated.h, ../../include/screen.h.generated.h
[ 50%] Generating auto/search.c.generated.h, ../../include/search.h.generated.h
[ 50%] Generating auto/sha256.c.generated.h, ../../include/sha256.h.generated.h
[ 50%] Generating auto/shada.c.generated.h, ../../include/shada.h.generated.h
[ 53%] Generating auto/spell.c.generated.h, ../../include/spell.h.generated.h
[ 53%] Generating auto/state.c.generated.h, ../../include/state.h.generated.h
[ 53%] Generating auto/strings.c.generated.h, ../../include/strings.h.generated.h
[ 53%] Generating auto/syntax.c.generated.h, ../../include/syntax.h.generated.h
[ 53%] Generating auto/tag.c.generated.h, ../../include/tag.h.generated.h
[ 53%] Generating auto/terminal.c.generated.h, ../../include/terminal.h.generated.h
[ 53%] Generating auto/tui/input.c.generated.h, ../../include/tui/input.h.generated.h
[ 53%] Generating auto/tui/tui.c.generated.h, ../../include/tui/tui.h.generated.h
[ 56%] Generating auto/ugrid.c.generated.h, ../../include/ugrid.h.generated.h
[ 56%] Generating auto/ui.c.generated.h, ../../include/ui.h.generated.h
[ 56%] Generating auto/ui_bridge.c.generated.h, ../../include/ui_bridge.h.generated.h
[ 56%] Generating auto/undo.c.generated.h, ../../include/undo.h.generated.h
[ 56%] Generating auto/version.c.generated.h, ../../include/version.h.generated.h
[ 56%] Generating auto/window.c.generated.h, ../../include/window.h.generated.h
[ 56%] Generating auto/regexp_nfa.c.generated.h, ../../include/regexp_nfa.h.generated.h
[ 56%] Generating ../../include/ex_cmds_enum.generated.h, auto/ex_cmds_defs.generated.h
[ 56%] [ 56%] Generating ../../include/auevents_enum.generated.h, auto/auevents_name_map.generated.h
Generating auto/options.generated.h
[ 56%] Generating auto/unicode_tables.generated.h
[ 56%] Generating auto/api/private/dispatch.c, ../../api_metadata.mpack
[ 56%] Generating auto/funcs.generated.h, ../../funcs_data.mpack
[ 59%] Generating auto/auto/api/private/dispatch.c.generated.h, ../../include/auto/api/private/dispatch.h.generated.h
cc1: fatal error: opening output file /home/vagrant/src/neovim/src/nvim/auto/auto/api/private/dispatch.i: No such file or directory
compilation terminated.
make[2]: *** [src/nvim/auto/auto/api/private/dispatch.c.generated.h] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/nvim/CMakeFiles/nvim.dir/all] Error 2
make: *** [all] Error 2

@bfredl
Copy link
Member

bfredl commented Sep 2, 2016

Oh, that surely seems to mess up the source tree... Seems we do do not really support in-tree builds (IIRC they are not recommended with cmake projects in general, but I'll see if the build instructions need clarification)

could you try mkdir build; cd build; cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib64 .. && make ?

@shosca
Copy link
Sponsor Author

shosca commented Sep 2, 2016

Ah..

Yep it builds fine like that.

@justinmk justinmk added the build building and installing Neovim using the provided scripts label Sep 2, 2016
@fwalch
Copy link
Member

fwalch commented Sep 4, 2016

One "solution" would be to disable in-source builds (as it will also overwrite the provided Makefile): http://stackoverflow.com/a/10306476/249642

@fwalch fwalch changed the title Build error because of cc1: fatal error: opening output file /home/vagrant/src/neovim/src/nvim/auto/auto/api/private/dispatch.i: No such file or directory Error when building in-source with CMake Sep 4, 2016
@justinmk
Copy link
Member

justinmk commented Sep 10, 2016

👍 For disabling in-source builds (unless there's an important use-case for that?). Probably best to use this solution (also allows us to show an informative message) instead of the undocumented CMAKE_DISABLE_IN_SOURCE_BUILD.

@justinmk justinmk added the complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md label Sep 10, 2016
@fwalch
Copy link
Member

fwalch commented Oct 12, 2016

In-source builds have been disabled in #5467.

@fwalch fwalch closed this as completed Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build building and installing Neovim using the provided scripts complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md
Projects
None yet
Development

No branches or pull requests

4 participants