Issues with encoding for cmake files for raspberry PICO - encoding

I'm not sure exactly what is going on, I'm using cmake 3.21.1 and have the latest 2019 build tools for visual studio, but here is the output of nmake:
AR10B2~1.EXE: error: CMakeFiles/Generated.dir/Generated.c.obj: No such file or directory
As you can see, there's some kind of encoding issue with cmake files. This is an empty hello world project.
C:\PICO\pico-project-generator\Generated\build>nmake
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 1%] Creating directories for 'ELF2UF2Build'
[ 2%] No download step for 'ELF2UF2Build'
[ 3%] No update step for 'ELF2UF2Build'
[ 5%] No patch step for 'ELF2UF2Build'
[ 6%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.29.30133.0
-- The CXX compiler identification is MSVC 19.29.30133.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/PICO/pico-project-generator/Generated/build/elf2uf2
[ 7%] Performing build step for 'ELF2UF2Build'
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.obj
main.cpp
C:\PICO\pico-sdk\tools\elf2uf2\main.cpp(328): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\PICO\pico-sdk\tools\elf2uf2\main.cpp(334): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[100%] Linking CXX executable elf2uf2.exe
[100%] Built target elf2uf2
[ 8%] No install step for 'ELF2UF2Build'
[ 10%] Completed 'ELF2UF2Build'
[ 10%] Built target ELF2UF2Build
Scanning dependencies of target bs2_default
[ 11%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[ 12%] Linking ASM executable bs2_default.elf
[ 12%] Built target bs2_default
[ 13%] Generating bs2_default.bin
[ 15%] Generating bs2_default_padded_checksummed.S
[ 15%] Built target bs2_default_padded_checksummed_asm
Scanning dependencies of target Generated
[ 16%] Building C object CMakeFiles/Generated.dir/Generated.c.obj
[ 17%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c.obj
[ 18%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_gpio/gpio.c.obj
[ 20%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_claim/claim.c.obj
[ 21%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_platform/platform.c.obj
[ 22%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_sync/sync.c.obj
[ 23%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_uart/uart.c.obj
[ 25%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_divider/divider.S.obj
[ 26%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_time/time.c.obj
[ 27%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_time/timeout_helper.c.obj
[ 28%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_timer/timer.c.obj
[ 30%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/sem.c.obj
[ 31%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/lock_core.c.obj
[ 32%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/mutex.c.obj
[ 33%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/critical_section.c.obj
[ 35%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/datetime.c.obj
[ 36%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/pheap.c.obj
[ 37%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/queue.c.obj
[ 38%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_runtime/runtime.c.obj
[ 40%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_clocks/clocks.c.obj
[ 41%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj
[ 42%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_irq/irq_handler_chain.S.obj
[ 43%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_pll/pll.c.obj
[ 45%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_vreg/vreg.c.obj
[ 46%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_watchdog/watchdog.c.obj
[ 47%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_xosc/xosc.c.obj
[ 48%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_printf/printf.c.obj
[ 50%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S.obj
[ 51%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_bootrom/bootrom.c.obj
[ 52%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_divider/divider.S.obj
[ 53%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_aeabi.S.obj
[ 55%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_init_rom.c.obj
[ 56%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_math.c.obj
[ 57%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_v1_rom_shim.S.obj
[ 58%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S.obj
[ 60%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_aeabi.S.obj
[ 61%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_init_rom.c.obj
[ 62%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_math.c.obj
[ 63%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_v1_rom_shim.S.obj
[ 65%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_malloc/pico_malloc.c.obj
[ 66%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S.obj
[ 67%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/crt0.S.obj
[ 68%] Building CXX object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj
[ 70%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c.obj
[ 71%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio/stdio.c.obj
[ 72%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/reset_interface.c.obj
[ 73%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb.c.obj
[ 75%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c.obj
[ 76%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c.obj
[ 77%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c.obj
[ 78%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/device/usbd.c.obj
[ 80%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/device/usbd_control.c.obj
[ 81%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/audio/audio_device.c.obj
[ 82%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/cdc/cdc_device.c.obj
[ 83%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/dfu/dfu_device.c.obj
[ 85%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/dfu/dfu_rt_device.c.obj
[ 86%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/hid/hid_device.c.obj
[ 87%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/midi/midi_device.c.obj
[ 88%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c.obj
[ 90%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/net/net_device.c.obj
[ 91%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/usbtmc/usbtmc_device.c.obj
[ 92%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/vendor/vendor_device.c.obj
[ 93%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/tusb.c.obj
[ 95%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/common/tusb_fifo.c.obj
[ 96%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c.obj
[ 97%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_unique_id/unique_id.c.obj
[ 98%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_flash/flash.c.obj
[100%] Linking CXX executable Generated.elf
AR10B2~1.EXE: error: CMakeFiles/Generated.dir/Generated.c.obj: No such file or directory
NMAKE : fatal error U1077: 'C:\PROGRA~2\GNUARM~1\102021~1.07\bin\AR10B2~1.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.

I had same problem and found the answer here
https://community.arm.com/developer/tools-software/tools/f/arm-compilers-forum/51380/windows-10-gnu-arm-toolchain-fails-if-a-command-line-file-contains-a-bom-byte-order-mark
Uninstall CMAKE cmake-3.21.2 and install cmake-3.20.5

My solution was to install the MinGW toolchain as a generator. It also resolves build issues with ELF2UF2 in any case of a full clean, and bypasses the need to use any of the Visual Studio 2019 Build Tools. I tested this in a virtual machine with a clean windows install here: https://youtu.be/BAoTBg8MJJ4

Related

Failed to apply plugin 'com.android.internal.version-check'

Im getting this error while running flutter app
FAILURE: Build failed with an exception.
[ +6 ms] * Where:
[ ] Build file 'F:\flutterdev\apps\calendar\android\app\build.gradle' line: 24
[ ] * What went wrong:
[ ] A problem occurred evaluating project ':app'.
[ ] > Failed to apply plugin 'com.android.internal.version-check'.
[ ] > Could not create plugin of type 'VersionCheckPlugin'.
[ ] > Could not generate a decorated class for type VersionCheckPlugin.
[ ] > Lcom/android/ide/common/repository/GradleVersion;
its good until I reinstalled visual studio code
does it have anything to do with it?
thanks for your help in future.
Try to upgrading gradle please make change in following floders-
In android/gradle/wrapper/gradle-wrapper.properties folder:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
and in android/build.gradle folder:
classpath "com.android.tools.build:gradle:7.0.1"

Swift Package - Distribute standalone executable with bundle

I'm writing a Swift script as a standalone Swift Package. Part of this script needs to generate some files, for which I have templates.
Now, these templates are not compilable (they're HTML files); so in order to include them in the package I've included them as .copy("Templates").
When debugging my script, I can access the templates just fine, but when I try to archive the product, the executable doesn't have access to them anymore.
Here's my Package.swift:
let package = Package(
name: "flucs",
products: [
.executable(name: "Flucs",
targets: ["flucs"])
],
dependencies: [
.package(url: "https://github.com/MrSkwiggs/Netswift", .exact(.init(0, 3, 1))),
],
targets: [
.target(
name: "flucs",
dependencies: ["Netswift"],
path: "Sources",
resources: [
.copy("Templates")
]),
.testTarget(
name: "flucsTests",
dependencies: ["flucs"]),
]
)
My folder structure:
How can I distribute my script so that it also includes its resources?
SPM compiles your resources to a separate bundle but command line tool is just an executable without a bundle and any resources you add to your executable is simply ignored by Xcode (Build Phases > Copy Bundle Resources) for Release(Archive) builds.
If you look inside Bundle.module you can find:
...
// For command-line tools.
Bundle.main.bundleURL,
...
Where Bundle.main.bundleURL is a valid file url for the directory containing your command line executable so that it looks for your bundle next to your executable. And it works for Debug because XCode just compiles your resource bundle near your executable.
The simplest way to get Release executable with compiled .bundle file is build your package from command line:
swift build --configuration release
And then you can find them both in .build/release folder.

Swift Unit Test Error: symbol(s) not found for architecture x86_64 (Swift Package Manager)

I am having trouble getting unit tests to run in Swift projects created with the Swift Package Manager (that is, any unit tests created by the Package Manager... those I create from within Xcode work fine from within Xcode). I am getting the same error on all projects generated from the Package Manager. To keep it simple, I tried on a very basic test project with as little modification from the default setup as possible, but still getting the error. Here are the steps to reproduce:
Create a new project with swift package init --type executable (module name is Hello)
Add the Xcode Project: swift package generate-xcodeproj
In Xcode build settings, ensure Enable Testability is Yes
In swift.main enter this simple test code:
import Foundation
let message = "Hello, world!"
print(message)
In HelloTests.swift:
import XCTest
#testable import Hello
class HelloTests: XCTestCase {
func testExample() {
XCTAssert(message == "Hello, world!")
}
static var allTests = [
("testExample", testExample),
]
}
Package.swift and XCTestManifests.swift left as-is.
It builds and runs fine with swift build and swift run Hello (Also, from within in Xcode).
However, when running swift test or running any test in Xcode, the build fails with the following error message:
Undefined symbols for architecture x86_64:
"Hello.message.unsafeMutableAddressor : Swift.String", referenced from:
implicit closure #1 : #autoclosure () throws -> Swift.Bool in HelloTests.HelloTests.testExample() -> () in HelloTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Somehow, it seems like it's failing to link the main module, so the symbols are not recognized. However, I can't tell what's wrong or how to fix it.
I downloaded one of the sample projects from GitHub, and generated the Xcode project. The tests for this project run perfectly in Xcode and the terminal. I've carefully compared the sample project to mine and can't tell what's different. Almost all setup code (Package.swift, file structure, etc.) and project setting are nearly identical. The only meaningful difference I can tell is that the sample project is a library/framework and mine is an executable (but seems like linking should work the same for both types). Otherwise, I can't tell what they are doing right and I am doing wrong.
I figured it out (thanks to Cristik's help). Executable modules are not testable (at least for now), so the solution was to move all definitions to a library module and leave just the main.swift file in the executable module. That way, all unit tests were run with the library as a dependency vs. the executable. The package.swift now looks like this:
let package = Package(
name: "HighestNumberPairing",
products: [
.executable(name: "HighestNumberPairing", targets: ["HighestNumberPairing"]),
.library(name: "NumberPairing", targets: ["NumberPairing"]),
],
dependencies: [],
targets: [
.target(
name: "HighestNumberPairing",
dependencies: ["NumberPairing"]),
.target(
name: "NumberPairing",
dependencies: []),
.testTarget(
name: "NumberPairingTests",
dependencies: ["NumberPairing"]),
]
)
The full program is here on Github.

What would cause the completion percentage of a command or process to change when executing it a second time in the same environment?

While attempting to install OpenCV I noticed that my first attempt aborted only 47% complete.
Once I executed "make -j8" again the percentage elevated to 60% completion.
1st attempt:
make -j8
Scanning dependencies of target zlib
Scanning dependencies of target libjasper
Scanning dependencies of target libjpeg
[ 0%] [ 0%] [ 0%] [ 0%] [ 0%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzclose.c.o
Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.c.o
[ 0%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzlib.c.o
[ 1%] [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzread.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapimin.c.o
[ 1%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_cm.c.o
[ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzwrite.c.o
[ 1%] [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inflate.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapistd.c.o
[ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/infback.c.o
[ 1%] [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inftrees.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jccoefct.c.o
[ 1%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_debug.c.o
[ 1%] [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inffast.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jccolor.c.o
[ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/trees.c.o
[ 1%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcdctmgr.c.o
[ 1%] [ 2%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_getopt.c.o
Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jchuff.c.o
[ 2%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/uncompr.c.o
.....
[ 47%] Built target opencv_calib3d
make: *** [all] Error 2
2nd attempt:
make -j8
[ 2%] Built target zlib
[ 7%] [ 11%] Built target libjasper
Built target libjpeg
[ 13%] Built target libpng
[ 18%] Built target libtiff
[ 21%] Built target opencv_core
[ 30%] Built target IlmImf
[ 30%] Built target opencv_flann
[ 32%] Built target opencv_ml
[ 37%] Built target opencv_imgproc
[ 37%] Built target opencv_photo
[ 39%] Built target opencv_video
[ 41%] Built target opencv_highgui
[ 44%] [ 45%] Built target opencv_objdetect
Built target opencv_features2d
[ 45%] [ 45%] [ 45%] [ 45%] [ 45%] [ 45%] [ 45%] [ 47%] Built target opencv_nonfree
Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts.cpp.o
Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/precomp.cpp.o
Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts_func.cpp.o
Built target opencv_calib3d
Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts_perf.cpp.o
Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts_gtest.cpp.o
Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts_arrtest.cpp.o
Scanning dependencies of target opencv_contrib
Scanning dependencies of target opencv_legacy
[ 47%] Building CXX object modules/contrib/CMakeFiles/opencv_contrib.dir/src/adaptiveskindetector.cpp.o
[ 47%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/3dtracker.cpp.o
...
[ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/prewarp.cpp.o
[ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/pyrsegmentation.cpp.o
[ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/scanlines.cpp.o
[ 59%] [ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/segment.cpp.o
Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/snakes.cpp.o
[ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/spilltree.cpp.o
[ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/stereogc.cpp.o
[ 59%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/subdiv2.cpp.o
[ 60%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/testseq.cpp.o
[ 60%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/texture.cpp.o
[ 60%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/trifocal.cpp.o
[ 60%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/vecfacetracking.cpp.o
[ 60%] Building CXX object modules/legacy/CMakeFiles/opencv_legacy.dir/src/video.cpp.o
Linking CXX shared library ../../lib/libopencv_legacy.dylib
[ 60%] Built target opencv_legacy
make: *** [all] Error 2
After several more attemps, I reached 72% completion and any further efforts returned the exact same results:
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/precomp.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts.cpp.o] Error 1
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts_arrtest.cpp.o] Error 1
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts_perf.cpp.o] Error 1
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts_func.cpp.o] Error 1
1 error generated.
make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts_gtest.cpp.o] Error 1
make[1]: *** [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2
make: *** [all] Error 2
Why should your progress change at all if you run the same command in the same environment?
make (witout using -k) stops at the first error. When starting make again it calculates the dependencies again ommiting already made stuff and if something other than the command causing the previous error is the 1st thing to do, it may succeed and so generate progress until the next error ist hit or the previosly seen error strikes again...
Repeating this will somewhen reach a point where starting make again and again will not generate progress because all things left to do depend on actions causing an error.
make -k will run as far as possible by not stopping for errors. Try this twice and there should not be further progress in the 2nd run.

Perl QtCore4 won't install

I can't build the QtCore4 package, I get an error regarding "SMOKE_QWT_LIBRARY" not being set during make. I'm running perlbrew Perl 5.14.2 on Ubuntu 12.04. I've tried manually building the module as well as through CPAN, and also installing on system Perl (also 5.14.2) and perl 5.16.1. I've looked in the files in the directory referenced in the error message. The file CMakeLists.txt contains the reference to "SMOKE_QWT_LIBRARY" but there is no directory reference or obvious way to re-configure the file (and I'm not sure what to reconfigure it to!).
Can anyone help with this please?
This is the make output:
Running install for module 'QtCore4'
Running make for C/CB/CBUREL/Qt4-0.99.0.tar.bz2
Checksum for /home/sillymoose/.cpan/sources/authors/id/C/CB/CBUREL/Qt4-
0.99.0.tar.bz2 ok
CPAN.pm: Building C/CB/CBUREL/Qt4-0.99.0.tar.bz2
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Perl: /home/sillymoose/perl5/perlbrew/perls/perl-
5.14.2/bin/perl
-- Found PerlLibs: /home/sillymoose/perl5/perlbrew/perls/perl-
5.14.2/lib/5.14.2/x86_64-linux/CORE/libperl.a (found version "5.14.2")
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found version "4.8.1")
-- Found QScintilla2: /usr/lib/libqscintilla2.so
-- Found QImageBlitz: /usr/include/qimageblitz
-- Phonon Version: 4.6.0
-- Found Phonon: /usr/lib/x86_64-linux-gnu/libphonon.so
-- Found Phonon Includes: /usr/include/qt4/KDE;/usr/include/qt4
-- Found Qwt: /usr/lib/libqwt-qt4.so
-- Perl headers found: /home/sillymoose/perl5/perlbrew/perls/perl-
5.14.2/lib/5.14.2/x86_64-linux/CORE
-- Perl headers found: /home/sillymoose/perl5/perlbrew/perls/perl-
5.14.2/lib/5.14.2/x86_64-linux/CORE
-- Build PerlQt bindings:
Phonon;QImageBlitz;QScintilla;Qt3Support;QtDBus;QtDeclarative;QtGui;QtHe
lp;QtNetwork;QtOpenGL;QtScript;QtSql;QtSvg;QtTest;QtUiTools;QtWebKit;QtX
ml;QtXmlPatterns;Qwt
-- Skip PerlQt bindings: QtMultimedia
------------------------------------------------------------------------
-----
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these
packages.
------------------------------------------------------------------------
-----
* QScintilla2 - QScintilla2 libraries
* QImageBlitz - QImageBlitz library
* Phonon - Phonon multimedia framework
* Qwt5 for Qt4 - Qwt5 libraries for Qt4
------------------------------------------------------------------------
-----
-- Congratulations! All external packages have been found.
------------------------------------------------------------------------
-----
CMake Error: The following variables are used in this project, but they
are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the
CMake files:
SMOKE_QWT_LIBRARY (ADVANCED)
linked by target "perl_qwt" in directory
/home/sillymoose/.cpan/build/Qt4-0.99.0-5Qxy7L/qwt/src
-- Configuring incomplete, errors occurred!
No 'Makefile' created CBUREL/Qt4-0.99.0.tar.bz2
/home/sillymoose/perl5/perlbrew/perls/perl-5.14.2/bin/perl Makefile.PL
-- NOT OK
And this is the contents of ~/.cpan/build/Qt4-0.99.0-5Qxy7L/qwt/src/CMakeLists.txt
include_directories(
${CMAKE_SOURCE_DIR}/qtcore/src
${PERL_INCLUDE_PATH}
${QT_INCLUDES} )
# Run doxsubpp.pl to run xsubpp on Qwt.xs
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Qwt.c
COMMAND ${PERL_EXECUTABLE} ARGS ${CMAKE_SOURCE_DIR}/qtcore/src/doxsubpp.pl ${PERL_EXECUTABLE} Qwt.xs ${CMAKE_CURRENT_BINARY_DIR}/Qwt.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Qwt.xs
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# Make sure we build Qwt.c as c++ code
set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/Qwt.c
PROPERTIES LANGUAGE CXX
)
set( CMAKE_CXX_FLAGS ${PERL_CXX_FLAGS} )
set(qwt_LIBRARY_SRC
${CMAKE_CURRENT_BINARY_DIR}/Qwt.c
qwthandlers.cpp
)
if(WIN32)
set(libraryName PerlQwt)
else()
set(libraryName Qwt)
endif(WIN32)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/blib/arch/auto/${libraryName})
add_library(perl_qwt SHARED ${qwt_LIBRARY_SRC})
target_link_libraries(perl_qwt
${SMOKE_QWT_LIBRARY}
perlqtcore4)
set_target_properties(perl_qwt PROPERTIES OUTPUT_NAME ${libraryName})
set_target_properties(perl_qwt PROPERTIES PREFIX "")
install(TARGETS perl_qwt DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
This problem was resolved on a thread on Perlmonks. See thread for details. However it involves:
Installing the correct source libraries.
Re-compiling Perl with the correct C flag.
Compiling the module from source.
NB. Could only get this to run on Perl v5.10.1.